diff --git a/setup.cfg b/setup.cfg index 6ebbc65a5..770dd1fb2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,3 +6,5 @@ all_files = 1 [upload_sphinx] upload-dir = doc/en/build/html +[bdist_wheel] +universal = 1 diff --git a/setup.py b/setup.py index 0e8b3509f..038e5f633 100644 --- a/setup.py +++ b/setup.py @@ -26,12 +26,25 @@ def get_version(): raise ValueError("could not read version") +def has_newish_setuptools(): + try: + import setuptools + return tuple(int(i) for i in str(setuptools.__version__).split('.')) > (0, 7) + except Exception: + return False + + def main(): install_requires = ['py>=1.4.25'] - if sys.version_info < (2, 7) or (3,) <= sys.version_info < (3, 2): - install_requires.append('argparse') - if sys.platform == 'win32': - install_requires.append('colorama') + extras_require = {} + if has_newish_setuptools(): + extras_require[':python_version=="2.6"'] = ['argparse'] + extras_require[':sys_platform=="win32"'] = ['colorama'] + else: + if sys.version_info < (2, 7) or (3,) <= sys.version_info < (3, 2): + install_requires.append('argparse') + if sys.platform == 'win32': + install_requires.append('colorama') setup( name='pytest', @@ -48,6 +61,7 @@ def main(): cmdclass={'test': PyTest}, # the following should be enabled for release install_requires=install_requires, + extras_require=extras_require, packages=['_pytest', '_pytest.assertion'], py_modules=['pytest'], zip_safe=False,