From: Arun Babu Neelicattu abn@redhat.com
--- setup.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/setup.py b/setup.py index c548fb5..be0ba59 100755 --- a/setup.py +++ b/setup.py @@ -166,6 +166,25 @@ class RPMCommand(Command): os.system("mv /tmp/python-bugzilla.spec .")
+requirements = {} + +try: + from pip.req import parse_requirements + + requirement_files = { + 'install_requires': 'requirements.txt', + 'tests_require': 'test-requirements.txt', + } + + for name, fname in requirement_files.items(): + requirements[name] = [ + str(ir.req) for ir in parse_requirements(fname) + ] +except ImportError: + # ignore as this is not useful without pip anyway + pass + + setup(name='python-bugzilla', version=get_version(), description='Bugzilla XMLRPC access module', @@ -181,5 +200,6 @@ setup(name='python-bugzilla', "pylint" : PylintCommand, "rpm" : RPMCommand, "test" : TestCommand, - } + }, + **requirements )
On 09/15/2014 06:17 PM, abn@redhat.com wrote:
From: Arun Babu Neelicattu abn@redhat.com
setup.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
Applying the patch, then running the test suite, I get this:
$ python setup.py test /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'tests_require' warnings.warn(msg) running test
diff --git a/setup.py b/setup.py index c548fb5..be0ba59 100755 --- a/setup.py +++ b/setup.py @@ -166,6 +166,25 @@ class RPMCommand(Command): os.system("mv /tmp/python-bugzilla.spec .")
+requirements = {}
+try:
- from pip.req import parse_requirements
- requirement_files = {
'install_requires': 'requirements.txt',
'tests_require': 'test-requirements.txt',
- }
- for name, fname in requirement_files.items():
requirements[name] = [
str(ir.req) for ir in parse_requirements(fname)
]
+except ImportError:
- # ignore as this is not useful without pip anyway
- pass
setup(name='python-bugzilla', version=get_version(), description='Bugzilla XMLRPC access module', @@ -181,5 +200,6 @@ setup(name='python-bugzilla', "pylint" : PylintCommand, "rpm" : RPMCommand, "test" : TestCommand,
}
},
**requirements
)
This is expected as distutils does not understand what to do with those options. The test environment, I suspect has pip installed hence adds both those options as expected.
hth
----- Original Message -----
From: "Cole Robinson" crobinso@redhat.com To: abn@redhat.com, python-bugzilla@lists.fedorahosted.org Sent: Tuesday, September 16, 2014 8:34:01 PM Subject: Re: [python-bugzilla] [PATCH] Handle requirements in setup.py
On 09/15/2014 06:17 PM, abn@redhat.com wrote:
From: Arun Babu Neelicattu abn@redhat.com
setup.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
Applying the patch, then running the test suite, I get this:
$ python setup.py test /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'tests_require' warnings.warn(msg) running test
diff --git a/setup.py b/setup.py index c548fb5..be0ba59 100755 --- a/setup.py +++ b/setup.py @@ -166,6 +166,25 @@ class RPMCommand(Command): os.system("mv /tmp/python-bugzilla.spec .")
+requirements = {}
+try:
- from pip.req import parse_requirements
- requirement_files = {
'install_requires': 'requirements.txt',
'tests_require': 'test-requirements.txt',
- }
- for name, fname in requirement_files.items():
requirements[name] = [
str(ir.req) for ir in parse_requirements(fname)
]
+except ImportError:
- # ignore as this is not useful without pip anyway
- pass
setup(name='python-bugzilla', version=get_version(), description='Bugzilla XMLRPC access module', @@ -181,5 +200,6 @@ setup(name='python-bugzilla', "pylint" : PylintCommand, "rpm" : RPMCommand, "test" : TestCommand,
}
},
**requirements
)
On 09/16/2014 07:16 AM, Arun Babu Neelicattu wrote:
This is expected as distutils does not understand what to do with those options. The test environment, I suspect has pip installed hence adds both those options as expected.
Alright, I've pushed it now
Thanks, Cole
----- Original Message -----
From: "Cole Robinson" crobinso@redhat.com To: abn@redhat.com, python-bugzilla@lists.fedorahosted.org Sent: Tuesday, September 16, 2014 8:34:01 PM Subject: Re: [python-bugzilla] [PATCH] Handle requirements in setup.py
On 09/15/2014 06:17 PM, abn@redhat.com wrote:
From: Arun Babu Neelicattu abn@redhat.com
setup.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
Applying the patch, then running the test suite, I get this:
$ python setup.py test /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'tests_require' warnings.warn(msg) running test
diff --git a/setup.py b/setup.py index c548fb5..be0ba59 100755 --- a/setup.py +++ b/setup.py @@ -166,6 +166,25 @@ class RPMCommand(Command): os.system("mv /tmp/python-bugzilla.spec .")
+requirements = {}
+try:
- from pip.req import parse_requirements
- requirement_files = {
'install_requires': 'requirements.txt',
'tests_require': 'test-requirements.txt',
- }
- for name, fname in requirement_files.items():
requirements[name] = [
str(ir.req) for ir in parse_requirements(fname)
]
+except ImportError:
- # ignore as this is not useful without pip anyway
- pass
setup(name='python-bugzilla', version=get_version(), description='Bugzilla XMLRPC access module', @@ -181,5 +200,6 @@ setup(name='python-bugzilla', "pylint" : PylintCommand, "rpm" : RPMCommand, "test" : TestCommand,
}
},
**requirements
)
python-bugzilla@lists.stg.fedorahosted.org