[openstack-dev] [devstack] issues with requiring python3 only tool?

Victor Stinner vstinner at redhat.com
Tue Jan 17 16:46:27 UTC 2017


Le 17/01/2017 à 17:36, Sean Dague a écrit :
> When putting the cli interface on it, I discovered python3's argparse
> has subparsers built in. This makes building up the cli much easier, and
> removes pulling in a dependency for that. (Currently the only item in
> requirements.txt is pbr). This is useful both from an ease to install,
> as well as overall runtime.

Do you mean the argparse module of the Python standard library? It is 
available on Python 2.7. Subparsers are also supported on Python 2.7, no?
https://docs.python.org/2/library/argparse.html#sub-commands

If you need a more recent version of argparse on Python 2.7, you might try:
https://pypi.python.org/pypi/argparse

But I'm not sure that this third-party module is used on Python 2.7, 
since import checks the stdlib before checking site-packages.

Victor



More information about the OpenStack-dev mailing list