diff options
author | Jannis Leidel <jannis@leidel.info> | 2012-06-22 18:39:45 +0200 |
---|---|---|
committer | Jannis Leidel <jannis@leidel.info> | 2012-06-22 18:39:45 +0200 |
commit | c80ab42b6d3a345d71c39c8bdab197015ad3ed4b (patch) | |
tree | b36a71b525bcabb5bd46e6c5696ecfd2b93b3aa8 /setup.py | |
parent | 1a3a9c099163126e9be49114ca57937d71777597 (diff) | |
parent | 5bc16dff8c78723273d41849635343e102421ac9 (diff) | |
download | virtualenv-1.7.2.tar.gz |
Merge branch 'release/1.7.2'1.7.2
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 90 |
1 files changed, 62 insertions, 28 deletions
@@ -1,16 +1,31 @@ -import sys, os +import os +import re +import shutil +import sys + try: from setuptools import setup - kw = {'entry_points': - """[console_scripts]\nvirtualenv = virtualenv:main\n""", - 'zip_safe': False} + setup_params = { + 'entry_points': { + 'console_scripts': [ + 'virtualenv=virtualenv:main', + 'virtualenv-%s.%s=virtualenv:main' % sys.version_info[:2] + ], + }, + 'zip_safe': False, + 'test_suite': 'nose.collector', + 'tests_require': ['nose', 'Mock'], + } except ImportError: from distutils.core import setup if sys.platform == 'win32': print('Note: without Setuptools installed you will have to use "python -m virtualenv ENV"') - kw = {} + setup_params = {} else: - kw = {'scripts': ['scripts/virtualenv']} + script = 'scripts/virtualenv' + script_ver = script + '-%s.%s' % sys.version_info[:2] + shutil.copy(script, script_ver) + setup_params = {'scripts': [script, script_ver]} here = os.path.dirname(os.path.abspath(__file__)) @@ -23,13 +38,35 @@ f = open(os.path.join(here, 'docs', 'news.txt')) long_description += "\n\n" + f.read() f.close() -setup(name='virtualenv', - # If you change the version here, change it in virtualenv.py and - # docs/conf.py as well - version="1.7.1.2", - description="Virtual Python Environment builder", - long_description=long_description, - classifiers=[ + +def get_version(): + f = open(os.path.join(here, 'virtualenv.py')) + version_file = f.read() + f.close() + version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", + version_file, re.M) + if version_match: + return version_match.group(1) + raise RuntimeError("Unable to find version string.") + + +# Hack to prevent stupid TypeError: 'NoneType' object is not callable error on +# exit of python setup.py test # in multiprocessing/util.py _exit_function when +# running python setup.py test (see +# http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html) +try: + import multiprocessing +except ImportError: + pass + +setup( + name='virtualenv', + # If you change the version here, change it in virtualenv.py and + # docs/conf.py as well + version=get_version(), + description="Virtual Python Environment builder", + long_description=long_description, + classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', @@ -41,18 +78,15 @@ setup(name='virtualenv', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.1', 'Programming Language :: Python :: 3.2', - ], - keywords='setuptools deployment installation distutils', - author='Ian Bicking', - author_email='ianb@colorstudy.com', - maintainer='Jannis Leidel, Carl Meyer and Brian Rosner', - maintainer_email='python-virtualenv@groups.google.com', - url='http://www.virtualenv.org', - license='MIT', - py_modules=['virtualenv'], - packages=['virtualenv_support'], - package_data={'virtualenv_support': ['*-py%s.egg' % sys.version[:3], '*.tar.gz']}, - test_suite='nose.collector', - tests_require=['nose', 'Mock'], - **kw - ) + ], + keywords='setuptools deployment installation distutils', + author='Ian Bicking', + author_email='ianb@colorstudy.com', + maintainer='Jannis Leidel, Carl Meyer and Brian Rosner', + maintainer_email='python-virtualenv@groups.google.com', + url='http://www.virtualenv.org', + license='MIT', + py_modules=['virtualenv'], + packages=['virtualenv_support'], + package_data={'virtualenv_support': ['*-py%s.egg' % sys.version[:3], '*.tar.gz']}, + **setup_params) |