-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
easy_install (setup.py install) doesn't ignore pre-releases #855
Comments
You're right. Your best bet is to use pip to install your packages (i.e. I would be interested in a patch that harmonizes the behavior between |
Using pip to install packages from
An alternative route, which I believe would be less painful for all parties involved, is to lift functionality from This would also help with things like having |
This is effectively already happening although |
Oh my! It seems pretty important to avoid installing pre-release builds! https://www.python.org/dev/peps/pep-0440/#handling-of-pre-releases I'm very new to python, so I'm not in a position to contribute code unfortunately... but it seems like based on the PEP above, it might even be sufficient (for now) to simply turn off pre-release installation (and let it only use pre-releases that are already installed, or in cases where no other release matches the requirements). Having pre-releases turned on by default seems like a worse option than not being able to install pre-releases at all. What is the rationale for having it turned on by default? |
Easy-install was implemented long before pep 440, back to around 2005. Back then, the version handling was more simple, with basic rules around version parsing and ordering. Easy-install would install what you asked for within the ranges you specified. There wasn't another 'pre-release' dimension (except that I don't think there's value at this point in implementing this behavior. Installation of packages to satisfy |
Ah - Thanks for the explanation! I'm working in an older project and I was not aware that From what I read, it sounds like I would still need to use (I'm asking because setuptools just started installing a pre-release version of |
Sorry for the confusion. Let me try to clarify.
Easy_install is setuptools' built-in installer and it's been superseded by pip. You should always use pip to install your package (never run |
Ah - thank you again! 🙏 I think I understand. Just to confirm though (and for posterity) - the most basic solution you are recommending is: keep setup.py as is, but instead of running To take it further, you mentioned that it may be useful to define some dependencies more explicitly in a pyproject.toml file (as per PEP 518 - although where to define which dependencies seems to be the topic of much debate). Finally, although you did not mention this, I think it's worth noting (and confirming) that the Python tutorial now recommends using pipenv and a Pipfile for managing application dependencies, in cases such as deployable/web applications: https://packaging.python.org/tutorials/managing-dependencies/ This is as opposed to projects that are to be distributed as a package, which should continue to define their dependencies as described above, using setuptools' Does that all seem accurate? |
Yes!
Yes. I personally don't distinguish between a deployable application and a library, so I use setuptools even for my own personal website, and so pipenv is a bad fit for my workflows. That said, it's perfectly reasonable if not preferable for someone developing an application to use a separate technique such as pipenv. |
easy_install (used with setup.py install) will install pre-releases which is unexpected and undesirable behavior. More information: pypa/setuptools#855
easy_install (used with setup.py install) will install pre-releases which is unexpected and undesirable behavior. More information: pypa/setuptools#855
…up.py install` (#8997) #### Why I did it Fix a recent build error introduced by a pre-release redis-py. This is a general issue because `python setup.py install` (ie `easy_instal`) does not ignore pre-release versions. The fix is suggested by pypa/setuptools#855 (comment)
…up.py install` (#8997) Fix a recent build error introduced by a pre-release redis-py. This is a general issue because `python setup.py install` (ie `easy_instal`) does not ignore pre-release versions. The fix is suggested by pypa/setuptools#855 (comment)
It looks like install_requires causes the latest version of a package, even pre-releases, to be installed. If I set up a simple
setup.py
file with Matplotlib as a dependency:it will currently download and install 2.0.0b4:
Ideally, this should behave like pip and only pick the latest real release (pip has a --pre flag to select pre-releases).
The text was updated successfully, but these errors were encountered: