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

Introduce installation order or a "priority install" feature. #5761

Closed
Demetrio92 opened this issue Sep 4, 2018 · 8 comments
Closed

Introduce installation order or a "priority install" feature. #5761

Demetrio92 opened this issue Sep 4, 2018 · 8 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@Demetrio92
Copy link

Demetrio92 commented Sep 4, 2018

Problem
I have a requirements.txt which just won't install automatically because package X depends on cython. Both of them are in the requirements.txt, but there is no way to tell pip to install cython first (even though cython is placed above the package X). So the line with cython in the file is simply useless. Everyone trying to set up the dev enviroment will figure out they need it.

Proposition 1
Install packages in the order of requirements.txt.
Example:

cython
cartopy

would install without a fail, but

cartopy
cython

would fail because cartopy depends on cython.

Gain: automatic installation saving millions of developers over the world the hassle of reading the traceback only to remember that pip still does not have this feature.

Alternative Solutions

  • Alternative 1 (workaround on the user side): use multiple requirements.txt. E.g.
    requirements_INSTALL_ME_FIRST.txt with cython in it, and then requirements.txt with the rest.
    At least those who read won't be caught by a surprise pip install -r requirements.txt fails.

  • Alternative 2 (implement the workaround on the pip side): add a property "priority", e.g.

cython, priority

or

cython==2.1, priority

would mean pip puts it into a separate temporary requirements-priority.txt and installs it first.

Additional context
#3480
#3481
#2362

https://stackoverflow.com/questions/5394356/how-to-specify-install-order-for-python-pip

@benoit-pierre
Copy link
Member

Alternative 3: the cartopy package switch to PEP 518 to declare it's build time dependency on Cython. I see that it's setup.py is doing some weird things too, instead of using setup_requires, which I'm pretty sure does not work with recent versions of setuptools.

@Demetrio92
Copy link
Author

@benoit-pierre I will forward it to them, thanks a lot!
And sorry for my misunderstanding of the general paradigm. Indeed, I think dependencies should be on the packages, not on requirements.txt

@pfmoore
Copy link
Member

pfmoore commented Sep 4, 2018

Agreed. This problem has been addressed by PEP 518 (which has only recently been added to pip, so it's fine that cartopy hasn't yet got round to updating to use the capability). There's no point in any other workaround for this problem in pip, when we already have a well-designed (hopefully!) standard solution.

@pfmoore
Copy link
Member

pfmoore commented Sep 4, 2018

And sorry for my misunderstanding of the general paradigm

@Demetrio92 No problem - it's fairly new functionality, so no surprise if people aren't familiar with it yet.

@benoit-pierre
Copy link
Member

Their work-around should be updated to:

Distribution().fetch_build_eggs(['Cython>=0.15.1', 'numpy>=1.10'])

@Demetrio92
Copy link
Author

@benoit-pierre
@pfmoore
Thanks both of you!

@sashgorokhov
Copy link

Their work-around should be updated to:

Distribution().fetch_build_eggs(['Cython>=0.15.1', 'numpy>=1.10'])

you just saved my life!

@lock
Copy link

lock bot commented May 31, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label May 31, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 31, 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

No branches or pull requests

4 participants