6 if sys
.version_info
[:2] < (2, 6):
7 sys
.exit('virtualenv requires Python 2.6 or higher.')
10 from setuptools
import setup
11 from setuptools
.command
.test
import test
as TestCommand
13 class PyTest(TestCommand
):
14 user_options
= [('pytest-args=', 'a', "Arguments to pass to py.test")]
16 def initialize_options(self
):
17 TestCommand
.initialize_options(self
)
18 self
.pytest_args
= None
20 def finalize_options(self
):
21 TestCommand
.finalize_options(self
)
23 self
.test_suite
= True
26 # import here, because outside the eggs aren't loaded
28 errno
= pytest
.main(self
.pytest_args
)
34 'virtualenv=virtualenv:main',
35 'virtualenv-%s.%s=virtualenv:main' % sys
.version_info
[:2]
39 'cmdclass': {'test': PyTest
},
40 'tests_require': ['pytest', 'mock'],
43 from distutils
.core
import setup
44 if sys
.platform
== 'win32':
45 print('Note: without Setuptools installed you will '
46 'have to use "python -m virtualenv ENV"')
49 script
= 'scripts/virtualenv'
50 script_ver
= script
+ '-%s.%s' % sys
.version_info
[:2]
51 shutil
.copy(script
, script_ver
)
52 setup_params
= {'scripts': [script
, script_ver
]}
55 def read_file(*paths
):
56 here
= os
.path
.dirname(os
.path
.abspath(__file__
))
57 with
open(os
.path
.join(here
, *paths
)) as f
:
60 # Get long_description from index.rst:
61 long_description
= read_file('docs', 'index.rst')
62 long_description
= long_description
.strip().split('split here', 1)[0]
64 long_description
+= "\n\n" + read_file('docs', 'changes.rst')
68 version_file
= read_file('virtualenv.py')
69 version_match
= re
.search(r
"^__version__ = ['\"]([^
'\"]*)['\"]",
72 return version_match.group(1)
73 raise RuntimeError("Unable to find version string
.")
76 # Hack to prevent stupid TypeError: 'NoneType' object is not callable error on
77 # exit of python setup.py test # in multiprocessing/util.py _exit_function when
78 # running python setup.py test (see
79 # http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)
81 import multiprocessing # noqa
87 version=get_version(),
88 description="Virtual Python Environment builder
",
89 long_description=long_description,
91 'Development Status :: 5 - Production/Stable',
92 'Intended Audience :: Developers',
93 'License :: OSI Approved :: MIT License',
94 'Programming Language :: Python :: 2',
95 'Programming Language :: Python :: 2.6',
96 'Programming Language :: Python :: 2.7',
97 'Programming Language :: Python :: 3',
98 'Programming Language :: Python :: 3.1',
99 'Programming Language :: Python :: 3.2',
101 keywords='setuptools deployment installation distutils',
102 author='Ian Bicking',
103 author_email='ianb@colorstudy.com',
104 maintainer='Jannis Leidel, Carl Meyer and Brian Rosner',
105 maintainer_email='python-virtualenv@groups.google.com',
106 url='https://virtualenv.pypa.io/',
108 py_modules=['virtualenv'],
109 packages=['virtualenv_support'],
110 package_data={'virtualenv_support': ['*.whl']},