Skip to content

Commit 8a7c50a

Browse files
committed
setup
1 parent 9e8a19b commit 8a7c50a

File tree

1 file changed

+50
-51
lines changed

1 file changed

+50
-51
lines changed

setup.py

Lines changed: 50 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,44 @@
33
import sys
44

55
if sys.version_info[:2] < (2, 7):
6-
sys.exit('virtualenv requires Python 2.7 or higher.')
6+
sys.exit("virtualenv requires Python 2.7 or higher.")
77
try:
88
from setuptools import setup, find_packages
99
from setuptools.command.test import test as TestCommand
1010

1111
class PyTest(TestCommand):
12-
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
12+
user_options = [("pytest-args=", "a", "Arguments to pass to py.test")]
1313

1414
def initialize_options(self):
1515
TestCommand.initialize_options(self)
1616
self.pytest_args = []
1717

1818
def finalize_options(self):
1919
TestCommand.finalize_options(self)
20-
#self.test_args = []
21-
#self.test_suite = True
20+
# self.test_args = []
21+
# self.test_suite = True
2222

2323
def run_tests(self):
2424
# import here, because outside the eggs aren't loaded
2525
import pytest
26+
2627
sys.exit(pytest.main(self.pytest_args))
2728

2829
setup_params = {
29-
'entry_points': {
30-
'console_scripts': ['virtualenv=virtualenv:main'],
31-
},
32-
'zip_safe': False,
33-
'cmdclass': {'test': PyTest},
34-
'tests_require': ['pytest', 'mock'],
30+
"entry_points": {"console_scripts": ["virtualenv=virtualenv:main"]},
31+
"zip_safe": False,
32+
"cmdclass": {"test": PyTest},
33+
"tests_require": ["pytest", "mock"],
3534
}
3635
except ImportError:
3736
from distutils.core import setup
38-
if sys.platform == 'win32':
39-
print('Note: without Setuptools installed you will '
40-
'have to use "python -m virtualenv ENV"')
37+
38+
if sys.platform == "win32":
39+
print("Note: without Setuptools installed you will " 'have to use "python -m virtualenv ENV"')
4140
setup_params = {}
4241
else:
43-
script = 'src/scripts/virtualenv'
44-
setup_params = {'scripts': [script]}
42+
script = "src/scripts/virtualenv"
43+
setup_params = {"scripts": [script]}
4544

4645

4746
def read_file(*paths):
@@ -51,33 +50,32 @@ def read_file(*paths):
5150

5251

5352
# Get long_description from index.rst:
54-
long_description_full = read_file('docs', 'index.rst')
55-
long_description = long_description_full.strip().split('split here', 1)[0]
53+
long_description_full = read_file("docs", "index.rst")
54+
long_description = long_description_full.strip().split("split here", 1)[0]
5655
# Add release history
57-
changes = read_file('docs', 'changes.rst')
56+
changes = read_file("docs", "changes.rst")
5857
# Only report last two releases for brevity
5958
releases_found = 0
6059
change_lines = []
6160
for line in changes.splitlines():
6261
change_lines.append(line)
63-
if line.startswith('--------------'):
62+
if line.startswith("--------------"):
6463
releases_found += 1
6564
if releases_found > 2:
6665
break
6766

68-
changes = '\n'.join(change_lines[:-2]) + '\n'
69-
changes += '`Full Changelog <https://virtualenv.pypa.io/en/latest/changes.html>`_.'
67+
changes = "\n".join(change_lines[:-2]) + "\n"
68+
changes += "`Full Changelog <https://virtualenv.pypa.io/en/latest/changes.html>`_."
7069
# Replace issue/pull directives
71-
changes = re.sub(r':pull:`(\d+)`', r'PR #\1', changes)
72-
changes = re.sub(r':issue:`(\d+)`', r'#\1', changes)
70+
changes = re.sub(r":pull:`(\d+)`", r"PR #\1", changes)
71+
changes = re.sub(r":issue:`(\d+)`", r"#\1", changes)
7372

74-
long_description += '\n\n' + changes
73+
long_description += "\n\n" + changes
7574

7675

7776
def get_version():
78-
version_file = read_file(os.path.join('src', 'virtualenv.py'))
79-
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
80-
version_file, re.M)
77+
version_file = read_file(os.path.join("src", "virtualenv.py"))
78+
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
8179
if version_match:
8280
return version_match.group(1)
8381
raise RuntimeError("Unable to find version string.")
@@ -93,32 +91,33 @@ def get_version():
9391
pass
9492

9593
setup(
96-
name='virtualenv',
94+
name="virtualenv",
9795
version=get_version(),
9896
description="Virtual Python Environment builder",
9997
long_description=long_description,
10098
classifiers=[
101-
'Development Status :: 5 - Production/Stable',
102-
'Intended Audience :: Developers',
103-
'License :: OSI Approved :: MIT License',
104-
'Programming Language :: Python :: 2',
105-
'Programming Language :: Python :: 2.7',
106-
'Programming Language :: Python :: 3',
107-
'Programming Language :: Python :: 3.4',
108-
'Programming Language :: Python :: 3.5',
109-
'Programming Language :: Python :: 3.6',
110-
'Programming Language :: Python :: 3.7',
99+
"Development Status :: 5 - Production/Stable",
100+
"Intended Audience :: Developers",
101+
"License :: OSI Approved :: MIT License",
102+
"Programming Language :: Python :: 2",
103+
"Programming Language :: Python :: 2.7",
104+
"Programming Language :: Python :: 3",
105+
"Programming Language :: Python :: 3.4",
106+
"Programming Language :: Python :: 3.5",
107+
"Programming Language :: Python :: 3.6",
108+
"Programming Language :: Python :: 3.7",
111109
],
112-
keywords='setuptools deployment installation distutils',
113-
author='Ian Bicking',
114-
author_email='[email protected]',
115-
maintainer='Jannis Leidel, Carl Meyer and Brian Rosner',
116-
maintainer_email='[email protected]',
117-
url='https://virtualenv.pypa.io/',
118-
license='MIT',
119-
package_dir={'': 'src'},
120-
py_modules=['virtualenv'],
121-
packages=find_packages('src'),
122-
package_data={'virtualenv_support': ['*.whl']},
123-
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
124-
**setup_params)
110+
keywords="setuptools deployment installation distutils",
111+
author="Ian Bicking",
112+
author_email="[email protected]",
113+
maintainer="Jannis Leidel, Carl Meyer and Brian Rosner",
114+
maintainer_email="[email protected]",
115+
url="https://virtualenv.pypa.io/",
116+
license="MIT",
117+
package_dir={"": "src"},
118+
py_modules=["virtualenv"],
119+
packages=find_packages("src"),
120+
package_data={"virtualenv_support": ["*.whl"]},
121+
python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
122+
**setup_params
123+
)

0 commit comments

Comments
 (0)