Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 387071 - >=dev-lang/python-2.7 should block dev-python/argparse
Summary: >=dev-lang/python-2.7 should block dev-python/argparse
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Python Gentoo Team
URL: http://docs.python.org/library/argpar...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-13 20:57 UTC by Denilson Sá Maia
Modified: 2012-12-08 16:08 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denilson Sá Maia 2011-10-13 20:57:05 UTC
Since Python 2.7, argparse has been added to the standard library:
http://docs.python.org/library/argparse.html
http://code.google.com/p/argparse/
http://pypi.python.org/pypi/argparse

Thus, dev-python/argparse package should not be installed with Python 2.7 or newer.

However, I'm not very sure about what to do, because it is still required for Python 2.4, 2.5, 2.6, and these versions are still in the portage tree. Maybe argparse should be restricted to be installed only in those versions (using RESTRICT_PYTHON_ABIS or PYTHON_DEPEND, I guess).

Also, packages that depend on dev-python/argparse should be modified to either depend on it, or on python 2.7+.


The only package I have installed that depends on argparse is app-portage/gentoolkit.


If a user is using Python 2.7 and has dev-python/argparse installed, then he may receive this warning on scripts that use both Pygame and argparse:

/usr/lib64/python2.7/site-packages/pygame/pkgdata.py:27: UserWarning: Module argparse was already imported from /usr/lib64/python2.7/argparse.pyc, but /usr/lib64/python2.7/site-packages is being added to sys.path
  from pkg_resources import resource_stream, resource_exists
Comment 1 Arfrever Frehtes Taifersar Arahesis 2011-10-13 21:42:12 UTC
Progress Overlay contains virtual/python-argparse, which depends on dev-python/argparse only when Python ABIs matching 2.4, 2.5, 2.6 or 3.1 Python ABIs patterns are enabled.
Comment 2 Denilson Sá Maia 2011-10-14 18:29:55 UTC
Just remember that Python versions are slotted, so a user might have both 2.6 and 2.7 installed (for instance), which means argparse would have to be installed only for 2.6.

Or maybe this is too complex, and just a simple solution that works for the most common case (and a "elog" message explaining it).
Comment 3 Mike Gilbert gentoo-dev 2011-12-22 19:36:00 UTC
Since we don't have the nifty abi use flags that Afrever's overlay utilizes, that isn't an option at this point.

We could simply not install the files if PYTHON_ABI = 2.7. RESTRICT_PYTHON_ABIS=2.7 could work for that, but needs testing. Specifically, if that is the only abi in USE_PYTHON, I am not sure what will happen.
Comment 4 Dale Lukas Peterson 2012-08-20 18:42:52 UTC
Any progress on identifying whether Python 2.7 is installed or not?  I run into this probelm when gentoolkit pulls in dev-python/argparse, even though I have Python 2.7.3 installed.  It would nice to find a way to fix this that argparse is only pulled in if the version of Python used doesn't have argparse.  According to the pypi argparse page: "As of Python >= 2.7 and >= 3.2, the argparse module is maintained within the Python standard library".
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-10-29 16:46:54 UTC
I have committed a virtual/python-argparse today, so we can start fixing packages to use it already. When packages are migrated, the argparse shouldn't be naturally depcleaned from systems.

There's also a new dev-python/argparse which is built only for those Python versions which don't have argparse built-in. It is temporarily masked however since it throws out an error if no such Python versions are installed. I will unmask it when the virtual lies around long enough for people to update the ebuilds.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-12-08 16:08:26 UTC
Considering the virtual initiative, I think we can close this bug. Hope you don't mind.