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

setup.py requires 'argparse' package on py2.7 while it is a built-in module #7

Open
dbarnett opened this issue Jan 31, 2014 · 1 comment
Labels

Comments

@dbarnett
Copy link
Collaborator

Reported by mgorny@gentoo.org, Apr 7, 2013

The 'argparse' package has been merged into Python in Python 2.7. This means that Python has a built-in 'argparse' module and there is no real reason to install the external 'argparse' on top of that.

For that reason, we have dropped the external 'argparse' for Python 2.7 in Gentoo. Sadly, this means that a8 fails to start because of the 'install_requires' clause in setup.py:

$ a8
Traceback (most recent call last):
  File "/usr/bin/a8-python2.7", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib64/python2.7/site-packages/pkg_resources.py", line 2803, in <module>
    working_set.require(__requires__)
  File "/usr/lib64/python2.7/site-packages/pkg_resources.py", line 697, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib64/python2.7/site-packages/pkg_resources.py", line 595, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: argparse
$ python -c 'import argparse; print "Yay!"'
Yay!

For that reason, I'd like to request that 'argparse' is listed in package dependencies only when the external argparse is really necessary. That is, in Python 2.6 and older (and 3.0 + 3.1 if those versions are supported).

I'm attaching a patch doing that.

@dbarnett
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant