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

Get rid of ez_setup.py and distribute_setup.py #202

Closed
nedbat opened this issue Oct 11, 2012 · 3 comments
Closed

Get rid of ez_setup.py and distribute_setup.py #202

nedbat opened this issue Oct 11, 2012 · 3 comments
Labels
bug Something isn't working install

Comments

@nedbat
Copy link
Owner

nedbat commented Oct 11, 2012

Originally reported by Chris McDonough (Bitbucket: chrism, GitHub: chrism)


I'd suggest getting rid of setup.py dependency on ez_setup.py and distribute_setup.py.

If someone has an older setup of Python 3.2.3 that has eg. distribute 0.6.24 installed:

#!bash
[chrism@perspire Python-3.2.3]$ bin/easy_install coverage
Searching for coverage
Reading http://pypi.python.org/simple/coverage/
Reading http://nedbatchelder.com/code/modules/coverage.html
Reading http://nedbatchelder.com/code/coverage
Reading http://nedbatchelder.com/code/coverage/3.5.1b1
Reading http://nedbatchelder.com/code/coverage/3.5.2b1
Reading http://nedbatchelder.com/code/coverage/3.4b1
Reading http://nedbatchelder.com/code/coverage/3.4b2
Reading http://nedbatchelder.com/code/coverage/3.5b1
Best match: coverage 3.5.3
Downloading http://pypi.python.org/packages/source/c/coverage/coverage-3.5.3.tar.gz#md5=5f1f523940c473faa8a9f6ca29f78efc
Processing coverage-3.5.3.tar.gz
Running coverage-3.5.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-s8o1kl/coverage-3.5.3/egg-dist-tmp-hyw4pc
The required version of distribute (>=0.6.27) is not available, and can't be installed while this script is running. Please install a more recent version first, using 'easy_install -U distribute'.

(Currently using distribute 0.6.24     
(/home/chrism/opt/tmp/Python-3.2.3/lib/python3.2/site-packages/distribute-0.6.24-py3.2.egg))
error: Setup script exited with 2

This is a bogus error, because that version of distribute would work just fine to install that version of coverage if distribute_setup.py were not used.

This isn't a terrible hardship interactively but it was a real problem for me while running tox, which creates a virtualenv under the hood using whatever version of virtualenv is installed. Since older virtualenvs ship with older distribute versions, there was be about a half hour of headscratching when this error occured during a tox run. The solution was to upgrade virtualenv to brandnewshiny, but this isn't always possible or desirable.

The reason to get rid of ez_setup.py is because it will have similar problems when executed and the version of setuptools/distribute installed doesn't match its worldview. (Grep for "was_imported" in ez_setup.py).

And of course the other reason is that you don't want to continually need to bump the versions of these files over time; it's a losing game.

Instead of relying on these files and "use_setuptools" in the setup.py, I'd either a) document that folks need either setuptools or distribute to install coverage or b) rely only on distutils.


@nedbat
Copy link
Owner Author

nedbat commented Oct 11, 2012

I would love to use only distutils. If you could help with that, or just point me to a project that provides a command-line script without needing setuptools etc, that would be great.

As a last resort, I could use setuptools without an auto-installation, but I'd like to understand my options for doing without it first.

@nedbat
Copy link
Owner Author

nedbat commented Oct 11, 2012

Original comment by Daniel Holth (Bitbucket: dholth, GitHub: dholth)


I think the right thing to do is to assume setuptools is available without including the bootstrap in setup.py. Everyone has setuptools, and if they don't, they do not want you to install it for them.

p.s. pip will run setup.py with setuptools, even if you do not import it.

@nedbat
Copy link
Owner Author

nedbat commented Nov 17, 2012

Fixed in <<changeset f0a908aeefd2 (bb)>>.

@nedbat nedbat closed this as completed Nov 17, 2012
@nedbat nedbat added major bug Something isn't working install labels Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working install
Projects
None yet
Development

No branches or pull requests

1 participant