Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a top level pip download command. #2995

Closed

Conversation

MathewJennings
Copy link

pip download -d path/to/download/directory behaves exactly like pip install --download path/to/download/directory. Added a deprecation warning to pip install --download. Addresses #2643

Review on Reviewable

@MathewJennings MathewJennings changed the title Create a top level pip download command. Addresses #2643 Create a top level pip download command. Jul 29, 2015
@MathewJennings MathewJennings force-pushed the add-pip-download-command branch from 76d9f1d to 70d89b3 Compare July 29, 2015 20:40

finder = self._build_package_finder(options, index_urls, session)
build_delete = (not (options.no_clean or options.build_dir))
wheel_cache = WheelCache(options.cache_dir, options.format_control)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems strange to have a wheel cache for the download command: if you want wheel, you can use the pip wheel command. I dont know what to think about it...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right. I probably left that in on accident, because I started download.py by copying install.py. I removed it in a git commit --amend.

@xavfernandez
Copy link
Member

Looks like a nice first step for the deprecation

@MathewJennings MathewJennings force-pushed the add-pip-download-command branch 2 times, most recently from 1b7ee1b to 009ec81 Compare July 29, 2015 21:58
@MathewJennings
Copy link
Author

@xavfernandez Do you know what's causing my third shard to fail? Seems external; reminds me of the errors we had with the mock update not too long ago.

@Ivoz
Copy link
Contributor

Ivoz commented Jul 30, 2015

Latest coverage is no longer supporting python 3.2, which is causing testing failure when run on that python version :/

@MathewJennings
Copy link
Author

Alright, CI is all passing now thanks to the changes @dstufft made regarding coverage over the weekend. Is this ready to be merged in?

Once it is I'd like to edit my other pull request over in #2965 to be built on top of pip download instead of pip install, as per @xavfernandez's advice.

@MathewJennings MathewJennings force-pushed the add-pip-download-command branch from 009ec81 to 54f8a81 Compare August 3, 2015 14:49
@patricklaw
Copy link

@dstufft @xavfernandez Could you take a look at this PR and #2965 when you get a chance? We're still blocking a downstream change on getting these merged in.

allow_all_prereleases=options.pre,
process_dependency_links=options.process_dependency_links,
session=session,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this method could moved to RequirementCommand since, it is shared between install, wheel and download commands.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, I just did this.

@xavfernandez
Copy link
Member

Like I've already said, I think it is a first simple step towards a new command.
But one part missing is the documentation of this new command (at least a single file juste like https://github.com/pypa/pip/blob/develop/docs/reference/pip_wheel.rst)

@MathewJennings
Copy link
Author

Thanks for your feedback @xavfernandez . I addressed your comments in the updated commit. Can you take a look at those changes?

@MathewJennings MathewJennings force-pushed the add-pip-download-command branch 3 times, most recently from 017e5d6 to f6c38d2 Compare August 7, 2015 18:08
@@ -498,6 +498,18 @@ def only_binary():
"options to setup.py install. If you are using an option with a "
"directory path, be sure to use absolute path.")

download_options = partial(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is it used ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 49 of download.py: cmd_opts.add_option(cmdoptions.download_options())
I copied this paradigm from install.py because of how similar pip download is to pip install. If you think this should not be included I will remove it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I saw it was declared but I didn't see where it was used by pip (no options.dowload_options used anywhere).

For pip install, it is used in https://github.com/pypa/pip/blob/develop/pip/commands/install.py#L208 and those options are passed down to the final setup.py install call when installing.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see! My mistake, I had not noticed I failed to pass it down further! Do you think it makes sense to have this here? I wasn't sure, which is why download_options ended up being half-implemented I suppose.

Since for pip install the install_options are only used in here https://github.com/pypa/pip/blob/develop/pip/commands/install.py#L307
I'm thinking maybe download_options doesn't need to exist the way install_options does. Shall I remove this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If neither of us sees its purpose, I guess you can probably remove it ;)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good -- I removed it. Do you think we're almost ready to merge this in? We're blocking on the download features over in #2965 to become available for a feature in pantsbuild/pants, and that PR is now blocking on this one.

@MathewJennings MathewJennings force-pushed the add-pip-download-command branch from f6c38d2 to 9959b52 Compare August 10, 2015 15:52
@xavfernandez
Copy link
Member

Looks good to me :)

You could even add a line to https://github.com/pypa/pip/blob/develop/CHANGES.txt

@MathewJennings
Copy link
Author

Thanks @xavfernandez, I really appreciate your help! I'm making that change now and pushing one final amended commit!

…stall --download does (which now has a deprecated warning, but still functions as expected).
@MathewJennings MathewJennings force-pushed the add-pip-download-command branch from 9959b52 to e243b4f Compare August 10, 2015 22:20
@patricklaw
Copy link

Sounds like this is all set? Anything else needed before a merge @dstufft @xavfernandez ?

@patricklaw
Copy link

Nudge. This is now almost a month old and it seems to have accumulated a merge conflict at this point. Is there anything preventing this from being merged? We're still blocking another pip PR and downstream code on this feature.

@xavfernandez
Copy link
Member

You can rebase your branch on develop, I think I will merge it

@patricklaw
Copy link

Since Mat is back to class and presumably busy, I'm going to resolve the merge conflicts and any test issues that have cropped up in #3085

I'll cc you there when Travis goes green.

@xavfernandez
Copy link
Member

Closing this one since #3085 got merged

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants