From d150cfed69a796bcbcb4a55a57193b8da8027750 Mon Sep 17 00:00:00 2001 From: Anthon van der Neut Date: Thu, 16 Oct 2014 07:55:14 +0200 Subject: - include argparse for 2.6 (tox would work because dependency on pytest includes it) - minor adaptation of test to 2.6 as the argparse 1.2 orders some help output differently from the 2.7+ version --- __init__.py | 2 +- setup.py | 4 ++-- test/test_program.py | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/__init__.py b/__init__.py index da35031..7434f51 100644 --- a/__init__.py +++ b/__init__.py @@ -32,7 +32,7 @@ def _convert_version(tup): # < -version_info = (0, 3, 1) +version_info = (0, 3, 2) __version__ = _convert_version(version_info) del _convert_version diff --git a/setup.py b/setup.py index e36bc9f..d41f485 100644 --- a/setup.py +++ b/setup.py @@ -115,8 +115,8 @@ class MyInstallLib(install_lib.install_lib): def main(): install_requires = [ ] - #if sys.version_info < (3, 4): - # install_requires.append("") + if sys.version_info[:2] == (2, 6): + install_requires.append("argparse") packages = [full_package_name] + [(full_package_name + '.' + x) for x in find_packages(exclude=['tests'])] setup( diff --git a/test/test_program.py b/test/test_program.py index e4bb947..6d7bc5b 100644 --- a/test/test_program.py +++ b/test/test_program.py @@ -157,7 +157,11 @@ class TestProgram: program._parse_args('-h'.split()) pho = ParseHelpOutput(capsys) assert pho.start('positional arguments', 'hg') - assert pho.somewhere('usage', 'c,d,f,e') + if sys.version_info[:2] == (2,6): + # 2.6 argparse scrambles order + assert pho.somewhere('usage', 'git,e,d,f') + else: + assert pho.somewhere('usage', 'c,d,f,e') assert pho.start('optional arguments', '--verbose') def test_help_sub_parser(self, capsys, program): -- cgit v1.2.1