Add support for building proper wheels (universal and proper dependency evnironment markers for argparse/colorama if setuptools is new-ish).

--HG--
branch : pytest-2.7
This commit is contained in:
Ionel Cristian Maries 2015-04-10 21:08:50 +03:00
parent 0e916460d8
commit b7d43c5a5d
2 changed files with 20 additions and 4 deletions

View File

@ -6,3 +6,5 @@ all_files = 1
[upload_sphinx] [upload_sphinx]
upload-dir = doc/en/build/html upload-dir = doc/en/build/html
[bdist_wheel]
universal = 1

View File

@ -26,12 +26,25 @@ def get_version():
raise ValueError("could not read 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(): def main():
install_requires = ['py>=1.4.25'] install_requires = ['py>=1.4.25']
if sys.version_info < (2, 7) or (3,) <= sys.version_info < (3, 2): extras_require = {}
install_requires.append('argparse') if has_newish_setuptools():
if sys.platform == 'win32': extras_require[':python_version=="2.6"'] = ['argparse']
install_requires.append('colorama') 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( setup(
name='pytest', name='pytest',
@ -48,6 +61,7 @@ def main():
cmdclass={'test': PyTest}, cmdclass={'test': PyTest},
# the following should be enabled for release # the following should be enabled for release
install_requires=install_requires, install_requires=install_requires,
extras_require=extras_require,
packages=['_pytest', '_pytest.assertion'], packages=['_pytest', '_pytest.assertion'],
py_modules=['pytest'], py_modules=['pytest'],
zip_safe=False, zip_safe=False,