-
-
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
setuptools and state of PEP 376 #371
Comments
Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco): I'm unsure the state of PEP 376 and One problem with PEP 376 is that it assumes that only one version of a package is every installed at any given time. It doesn't account for Another issue is that PEP 376 assumes the introduction of Distutils2, which is a defunct project, in part because the effort required to produce a new format that could readily supersede and obviate the existing approach was a challenging task with many pitfalls and challenges. Perhaps the most daunting problem is that of namespace packages. The PEP 376 model (and the distutils model prior to PEP 420) specify that a package exists in exactly one place on sys.path. Setuptools instead manages namespace packages such that they need not be merged into the same directory, but can exist as separate distributions and merged at run time. As of yet, I don't believe the PEP 376 model or the pip implementation has support for "editable" projects for a namespace package, when other packages of the same namespace are present (see pip 3). Setuptools sought out to build a tooling infrastructure to tackle all of these problems, and in largely achieving that goal, has created a pretty high expectations. Can setuptools generate a Can the distutils/pip model obviate the setuptools model of .egg directories? Not in general, and specifically not for namespace packages on systems prior to the implementation of PEP 420 (Python 3.3). Even with PEP 420, support for multi-version installs would have to be dropped for the "one directory per package" model to be viable. I invite @ncoghlan to comment. Should PEP 376 be considered defunct along with Distutils2, or should the aforementioned features of Setuptools be considered in violation of PEP 376 and start to wean users off of these (useful) models? Is there another option? |
Original comment by cournape (Bitbucket: cournape, GitHub: cournape): Hi Jason, I understand the backward compatibility worries. So let me split the discussion in the various parts:
Would it be more workable if 3. was "opt-in" ? The consensus in the scientific python community is to avoid setuptools because we do not want the "install in a versioned directory" model and its associated costs (additional IO, complexity). If there was an option we could pass to If opt-in for 3 is workable, I would be happy to make a proof of concept for 1. and 2., and do some hustling in the scientific community to move to setuptools. I know @ogrisel is interested in this for scikit learn, and if numpy, scipy (the projects I am involved w/) + scikit learn move to this, I would expect most of the community to move fairly quickly. |
Original comment by ogrisel (Bitbucket: ogrisel, GitHub: ogrisel): In the case of numpy, scipy, scikit-learn I think the majority of the developers would like to have a default In my opinion, the easy switch between versions case is better addressed with isolated runtime environments (such as virtualenv or conda environments for instance). I would be +1 to have a setuptools option to disable the .egg folder features and use flat packages in |
Original comment by dholth (Bitbucket: dholth, GitHub: dholth): The .dist-info directory by itself shouldn't prevent egg-style "one dist per sys.path entry" installs, even though PEP 376 definitely assumes that all installed packages should be copied on top of each other to a single site-packages directory. bdist_wheel preserves egg-info-writers metadata in .dist-info/ including namespace_packages.txt The egg-style install is a very important use case. Would anything have to change with .dist-info to allow editable installations? How are editable installations special apart from the obvious aspect of pointing to a source directory? (We might also have to sanction or change a regexp to support unversioned .dist-info directories.) |
Original comment by ogrisel (Bitbucket: ogrisel, GitHub: ogrisel): I think the way the I think the initial request was more to provide a way to have setuptools install a source distribution that can replicate the behavior of installing a wheel distribution as documented in PEP 427:
It does not have to be default behavior of setuptools. Maybe it would be provided as an alternative |
Original comment by ncoghlan (Bitbucket: ncoghlan, GitHub: ncoghlan): PEP 376 is still the current installation database specification for interoperability purposes. For setuptools, it only applies to the "--single-version-externally-managed" model, as PEP 376 is designed to have environment switching handled by a separate utility like virtualenv/venv, conda, nix or environment modules, rather than doing it through runtime sys.path manipulation as pkg_resources does. |
Original comment by rbtcollins (Bitbucket: rbtcollins, GitHub: rbtcollins): So, sounds like doing this for just --single-version-externally-managed would be strictly better than not doing it. We should probably make distutils itself do it to... OR we could pull the wrapping glue of of pip and put it somewhere (e.g. packaging) where any package manager that wants this can use it; and have setuptools use it from there. |
Original comment by embray (Bitbucket: embray, GitHub: embray): The problem with all this is that many users of our software know that they should use In either case you end up with a Python system built out of packages installed in two very different ways with different results, and it often ends up in a mess (especially if packages belonging to a namespace package are installed by both methods on the same system--it will break the namespace packages). In some ways this is more a social problem than a technical problem. But it doesn't help that for years we've been telling users Update: I should add, I think multi-version installs are great in ecosystems that make consistent use of them, and I wish the Python language had explicit support for multiple package versions to make this better. But certainly in the scientific community this has not been the case--either virtualenv or now conda envs are used to support this case, and egg installs are not especially useful and only create confusion. |
Original comment by dholth (Bitbucket: dholth, GitHub: dholth): Just have setuptools add installed-files.txt to the egg-info directory. pip has been doing this for a long time before .dist-info was on the radar. In the future we should have sdists where "setup.py install" is not implemented and the installer is required. |
Original comment by embray (Bitbucket: embray, GitHub: embray): @dholth has a good point--to get more or less consistent installs we could add to all projects' setup.cfg something like:
and get mostly consistent behavior across install methods. However, installing this way will not install dependencies from |
Original comment by rbtcollins (Bitbucket: rbtcollins, GitHub: rbtcollins): I'm not sure how install_requires ties in here, can you expand on that? Thats already addressed by using either pip or easy-install [which setuptools has internally, right?] or buildout etc etc etc. |
Original comment by ogrisel (Bitbucket: ogrisel, GitHub: ogrisel): Thanks Erik for the suggestion. The execution order of
The generated Note that that does not prevent pip to uninstall scikit-learn properly as |
Original comment by embray (Bitbucket: embray, GitHub: embray): Right, I think the @rbtcollins My point regarding |
Originally reported by: cournape (Bitbucket: cournape, GitHub: cournape)
Hi there,
I was wondering whether the setuptools team were willing to support PEP 376 (adding .dist-info directories when doing
python setup.py install
) ?The context: doing a
python setup.py install
for package foo and then later on doing apip install foo
does not work because thesetup.py install
step does not create a.dist-info
directory, and in particular there is no RECORD file for pip to uninstall files. I would like to fix this as this has been a recurrent pain point in the scientific python community.Also, what is the feeling around deprecating "egg dir install" so that by default
python setup.py install
would install foo insite-package/foo
instead ofsite-packages/foo-1.0.egg
? Or is that considered too radical of a change ?@ogrisel
The text was updated successfully, but these errors were encountered: