We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
AttributeError: 'module' object has no attribute 'chdir' in 25.0.1
The new `setuptools == 25.0.1` just failed on our CI with `AttributeError: 'module' object has no attribute 'chdir'`.

The new expression [`here and os.path.chdir(here)`](https://github.com/pypa/setuptools/blob/21ab99e53f0c263a2210cf51525d6edcae1ae9a7/setup.py#L194) in `setup.py` was probably meant to use `os.chdir()`, since `os.path` has no `chdir()`.

_(Note: Lots of buildout related noise in the traceback, but I didn't want to truncate it and risk omitting relevant info)_

```
Getting distribution for 'setuptools'.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/command/easy_install.py", line 2245, in main
    distclass=DistributionWithoutHelpCommands, **kw
  File "/usr/local/python/2.7.10/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/local/python/2.7.10/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/python/2.7.10/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/command/easy_install.py", line 380, in run
    self.easy_install(spec, not self.no_deps)
  File "/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/command/easy_install.py", line 610, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/command/easy_install.py", line 659, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/command/easy_install.py", line 842, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/command/easy_install.py", line 1070, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/command/easy_install.py", line 1056, in run_setup
    run_setup(setup_script, args)
  File "/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py", line 240, in run_setup
    raise
  File "/usr/local/python/2.7.10/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py", line 193, in setup_context
    yield
  File "/usr/local/python/2.7.10/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py", line 164, in save_modules
    saved_exc.resume()
  File "/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py", line 139, in resume
    compat.reraise(type, exc, self._tb)
  File "/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py", line 152, in save_modules
    yield saved
  File "/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py", line 193, in setup_context
    yield
  File "/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py", line 237, in run_setup
    DirectorySandbox(setup_dir).run(runner)
  File "/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py", line 267, in run
    return func()
  File "/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py", line 236, in runner
    _execfile(setup_script, ns)
  File "/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py", line 46, in _execfile
    exec(code, globals, locals)
  File "/tmp/easy_install-6d2nJI/setuptools-25.0.1/setup.py", line 194, in <module>

AttributeError: 'module' object has no attribute 'chdir'
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 #!/usr/bin/env python
2 """
3 Distutils setup file, used to install or test 'setuptools'
4 """
5 
6 import io
7 import os
8 import sys
9 import textwrap
10 
11 import setuptools
12 
13 
14 here = os.path.dirname(__file__)
15 
16 
17 def require_metadata():
18     "Prevent improper installs without necessary metadata. See #659"
19     if not os.path.exists('setuptools.egg-info'):
20         msg = "Cannot build setuptools without metadata. Run bootstrap.py"
21         raise RuntimeError(msg)
22 
23 
24 def read_commands():
25     command_ns = {}
26     cmd_module_path = 'setuptools/command/__init__.py'
27     init_path = os.path.join(here, cmd_module_path)
28     with open(init_path) as init_file:
29         exec(init_file.read(), command_ns)
30     return command_ns['__all__']
31 
32 
33 def _gen_console_scripts():
34     yield "easy_install = setuptools.command.easy_install:main"
35 
36     # Gentoo distributions manage the python-version-specific scripts
37     # themselves, so those platforms define an environment variable to
38     # suppress the creation of the version-specific scripts.
39     var_names = (
40         'SETUPTOOLS_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT',
41         'DISTRIBUTE_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT',
42     )
43     if any(os.environ.get(var) not in (None, "", "0") for var in var_names):
44         return
45     yield ("easy_install-{shortver} = setuptools.command.easy_install:main"
46         .format(shortver=sys.version[:3]))
47 
48 
49 readme_path = os.path.join(here, 'README.rst')
50 with io.open(readme_path, encoding='utf-8') as readme_file:
51     long_description = readme_file.read()
52 
53 package_data = dict(
54     setuptools=['script (dev).tmpl', 'script.tmpl', 'site-patch.py'],
55 )
56 
57 force_windows_specific_files = (
58     os.environ.get("SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES")
59     not in (None, "", "0")
60 )
61 
62 include_windows_files = (
63     sys.platform == 'win32' or
64     os.name == 'java' and os._name == 'nt' or
65     force_windows_specific_files
66 )
67 
68 if include_windows_files:
69     package_data.setdefault('setuptools', []).extend(['*.exe'])
70     package_data.setdefault('setuptools.command', []).extend(['*.xml'])
71 
72 needs_pytest = set(['ptr', 'pytest', 'test']).intersection(sys.argv)
73 pytest_runner = ['pytest-runner'] if needs_pytest else []
74 needs_wheel = set(['release', 'bdist_wheel']).intersection(sys.argv)
75 wheel = ['wheel'] if needs_wheel else []
76 
77 
78 def pypi_link(pkg_filename):
79     """
80     Given the filename, including md5 fragment, construct the
81     dependency link for PyPI.
82     """
83     root = 'https://pypi.python.org/packages/source'
84     name, sep, rest = pkg_filename.partition('-')
85     parts = root, name[0], name, pkg_filename
86     return '/'.join(parts)
87 
88 
89 setup_params = dict(
90     name="setuptools",
91     version="25.0.1",
92     description="Easily download, build, install, upgrade, and uninstall "
93         "Python packages",
94     author="Python Packaging Authority",
95     author_email="distutils-sig@python.org",
96     long_description=long_description,
97     keywords="CPAN PyPI distutils eggs package management",
98     url="https://github.com/pypa/setuptools",
99     src_root=None,
100     packages=setuptools.find_packages(exclude=['*.tests']),
101     package_data=package_data,
102 
103     py_modules=['easy_install'],
104 
105     zip_safe=True,
106 
107     entry_points={
108         "distutils.commands": [
109             "%(cmd)s = setuptools.command.%(cmd)s:%(cmd)s" % locals()
110             for cmd in read_commands()
111         ],
112         "distutils.setup_keywords": [
113             "eager_resources        = setuptools.dist:assert_string_list",
114             "namespace_packages     = setuptools.dist:check_nsp",
115             "extras_require         = setuptools.dist:check_extras",
116             "install_requires       = setuptools.dist:check_requirements",
117             "tests_require          = setuptools.dist:check_requirements",
118             "setup_requires         = setuptools.dist:check_requirements",
119             "python_requires        = setuptools.dist:check_specifier",
120             "entry_points           = setuptools.dist:check_entry_points",
121             "test_suite             = setuptools.dist:check_test_suite",
122             "zip_safe               = setuptools.dist:assert_bool",
123             "package_data           = setuptools.dist:check_package_data",
124             "exclude_package_data   = setuptools.dist:check_package_data",
125             "include_package_data   = setuptools.dist:assert_bool",
126             "packages               = setuptools.dist:check_packages",
127             "dependency_links       = setuptools.dist:assert_string_list",
128             "test_loader            = setuptools.dist:check_importable",
129             "test_runner            = setuptools.dist:check_importable",
130             "use_2to3               = setuptools.dist:assert_bool",
131             "convert_2to3_doctests  = setuptools.dist:assert_string_list",
132             "use_2to3_fixers        = setuptools.dist:assert_string_list",
133             "use_2to3_exclude_fixers = setuptools.dist:assert_string_list",
134         ],
135         "egg_info.writers": [
136             "PKG-INFO = setuptools.command.egg_info:write_pkg_info",
137             "requires.txt = setuptools.command.egg_info:write_requirements",
138             "entry_points.txt = setuptools.command.egg_info:write_entries",
139             "eager_resources.txt = setuptools.command.egg_info:overwrite_arg",
140             "namespace_packages.txt = setuptools.command.egg_info:overwrite_arg",
141             "top_level.txt = setuptools.command.egg_info:write_toplevel_names",
142             "depends.txt = setuptools.command.egg_info:warn_depends_obsolete",
143             "dependency_links.txt = setuptools.command.egg_info:overwrite_arg",
144         ],
145         "console_scripts": list(_gen_console_scripts()),
146 
147         "setuptools.installation":
148             ['eggsecutable = setuptools.command.easy_install:bootstrap'],
149     },
150 
151 
152     classifiers=textwrap.dedent("""
153         Development Status :: 5 - Production/Stable
154         Intended Audience :: Developers
155         License :: OSI Approved :: MIT License
156         Operating System :: OS Independent
157         Programming Language :: Python :: 2.6
158         Programming Language :: Python :: 2.7
159         Programming Language :: Python :: 3
160         Programming Language :: Python :: 3.3
161         Programming Language :: Python :: 3.4
162         Programming Language :: Python :: 3.5
163         Topic :: Software Development :: Libraries :: Python Modules
164         Topic :: System :: Archiving :: Packaging
165         Topic :: System :: Systems Administration
166         Topic :: Utilities
167         """).strip().splitlines(),
168     extras_require={
169         "ssl:sys_platform=='win32'": "wincertstore==0.2",
170         "certs": "certifi==2016.2.28",
171     },
172     dependency_links=[
173         pypi_link(
174             'certifi-2016.2.28.tar.gz#md5=5d672aa766e1f773c75cfeccd02d3650',
175         ),
176         pypi_link(
177             'wincertstore-0.2.zip#md5=ae728f2f007185648d0c7a8679b361e2',
178         ),
179     ],
180     scripts=[],
181     tests_require=[
182         'setuptools[ssl]',
183         'pytest-flake8',
184         # workaround for pytest-flake8 #7
185         'flake8<3dev',
186         'pytest>=2.8',
187     ] + (['mock'] if sys.version_info[:2] < (3, 3) else []),
188     setup_requires=[
189     ] + pytest_runner + wheel,
190 )
191 
192 if __name__ == '__main__':
193     # allow setup.py to run from another directory
194     here and os.path.chdir(here)
195     require_metadata()
196     dist = setuptools.setup(**setup_params)
197
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -191,6 +191,6 @@
 
 if __name__ == '__main__':
     # allow setup.py to run from another directory
-    here and os.path.chdir(here)
+    here and os.chdir(here)
     require_metadata()
     dist = setuptools.setup(**setup_params)

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -191,6 +191,6 @@\n \n if __name__ == '__main__':\n     # allow setup.py to run from another directory\n-    here and os.path.chdir(here)\n+    here and os.chdir(here)\n     require_metadata()\n     dist = setuptools.setup(**setup_params)\n", "issue": "AttributeError: 'module' object has no attribute 'chdir' in 25.0.1\nThe new `setuptools == 25.0.1` just failed on our CI with `AttributeError: 'module' object has no attribute 'chdir'`.\n\nThe new expression [`here and os.path.chdir(here)`](https://github.com/pypa/setuptools/blob/21ab99e53f0c263a2210cf51525d6edcae1ae9a7/setup.py#L194) in `setup.py` was probably meant to use `os.chdir()`, since `os.path` has no `chdir()`.\n\n_(Note: Lots of buildout related noise in the traceback, but I didn't want to truncate it and risk omitting relevant info)_\n\n```\nGetting distribution for 'setuptools'.\nTraceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/command/easy_install.py\", line 2245, in main\n    distclass=DistributionWithoutHelpCommands, **kw\n  File \"/usr/local/python/2.7.10/lib/python2.7/distutils/core.py\", line 151, in setup\n    dist.run_commands()\n  File \"/usr/local/python/2.7.10/lib/python2.7/distutils/dist.py\", line 953, in run_commands\n    self.run_command(cmd)\n  File \"/usr/local/python/2.7.10/lib/python2.7/distutils/dist.py\", line 972, in run_command\n    cmd_obj.run()\n  File \"/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/command/easy_install.py\", line 380, in run\n    self.easy_install(spec, not self.no_deps)\n  File \"/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/command/easy_install.py\", line 610, in easy_install\n    return self.install_item(None, spec, tmpdir, deps, True)\n  File \"/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/command/easy_install.py\", line 659, in install_item\n    dists = self.install_eggs(spec, download, tmpdir)\n  File \"/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/command/easy_install.py\", line 842, in install_eggs\n    return self.build_and_install(setup_script, setup_base)\n  File \"/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/command/easy_install.py\", line 1070, in build_and_install\n    self.run_setup(setup_script, setup_base, args)\n  File \"/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/command/easy_install.py\", line 1056, in run_setup\n    run_setup(setup_script, args)\n  File \"/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py\", line 240, in run_setup\n    raise\n  File \"/usr/local/python/2.7.10/lib/python2.7/contextlib.py\", line 35, in __exit__\n    self.gen.throw(type, value, traceback)\n  File \"/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py\", line 193, in setup_context\n    yield\n  File \"/usr/local/python/2.7.10/lib/python2.7/contextlib.py\", line 35, in __exit__\n    self.gen.throw(type, value, traceback)\n  File \"/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py\", line 164, in save_modules\n    saved_exc.resume()\n  File \"/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py\", line 139, in resume\n    compat.reraise(type, exc, self._tb)\n  File \"/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py\", line 152, in save_modules\n    yield saved\n  File \"/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py\", line 193, in setup_context\n    yield\n  File \"/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py\", line 237, in run_setup\n    DirectorySandbox(setup_dir).run(runner)\n  File \"/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py\", line 267, in run\n    return func()\n  File \"/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py\", line 236, in runner\n    _execfile(setup_script, ns)\n  File \"/var/lib/jenkins/zope/eggs/setuptools-18.2-py2.7.egg/setuptools/sandbox.py\", line 46, in _execfile\n    exec(code, globals, locals)\n  File \"/tmp/easy_install-6d2nJI/setuptools-25.0.1/setup.py\", line 194, in <module>\n\nAttributeError: 'module' object has no attribute 'chdir'\n```\n\n", "before_files": [{"content": "#!/usr/bin/env python\n\"\"\"\nDistutils setup file, used to install or test 'setuptools'\n\"\"\"\n\nimport io\nimport os\nimport sys\nimport textwrap\n\nimport setuptools\n\n\nhere = os.path.dirname(__file__)\n\n\ndef require_metadata():\n    \"Prevent improper installs without necessary metadata. See #659\"\n    if not os.path.exists('setuptools.egg-info'):\n        msg = \"Cannot build setuptools without metadata. Run bootstrap.py\"\n        raise RuntimeError(msg)\n\n\ndef read_commands():\n    command_ns = {}\n    cmd_module_path = 'setuptools/command/__init__.py'\n    init_path = os.path.join(here, cmd_module_path)\n    with open(init_path) as init_file:\n        exec(init_file.read(), command_ns)\n    return command_ns['__all__']\n\n\ndef _gen_console_scripts():\n    yield \"easy_install = setuptools.command.easy_install:main\"\n\n    # Gentoo distributions manage the python-version-specific scripts\n    # themselves, so those platforms define an environment variable to\n    # suppress the creation of the version-specific scripts.\n    var_names = (\n        'SETUPTOOLS_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT',\n        'DISTRIBUTE_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT',\n    )\n    if any(os.environ.get(var) not in (None, \"\", \"0\") for var in var_names):\n        return\n    yield (\"easy_install-{shortver} = setuptools.command.easy_install:main\"\n        .format(shortver=sys.version[:3]))\n\n\nreadme_path = os.path.join(here, 'README.rst')\nwith io.open(readme_path, encoding='utf-8') as readme_file:\n    long_description = readme_file.read()\n\npackage_data = dict(\n    setuptools=['script (dev).tmpl', 'script.tmpl', 'site-patch.py'],\n)\n\nforce_windows_specific_files = (\n    os.environ.get(\"SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES\")\n    not in (None, \"\", \"0\")\n)\n\ninclude_windows_files = (\n    sys.platform == 'win32' or\n    os.name == 'java' and os._name == 'nt' or\n    force_windows_specific_files\n)\n\nif include_windows_files:\n    package_data.setdefault('setuptools', []).extend(['*.exe'])\n    package_data.setdefault('setuptools.command', []).extend(['*.xml'])\n\nneeds_pytest = set(['ptr', 'pytest', 'test']).intersection(sys.argv)\npytest_runner = ['pytest-runner'] if needs_pytest else []\nneeds_wheel = set(['release', 'bdist_wheel']).intersection(sys.argv)\nwheel = ['wheel'] if needs_wheel else []\n\n\ndef pypi_link(pkg_filename):\n    \"\"\"\n    Given the filename, including md5 fragment, construct the\n    dependency link for PyPI.\n    \"\"\"\n    root = 'https://pypi.python.org/packages/source'\n    name, sep, rest = pkg_filename.partition('-')\n    parts = root, name[0], name, pkg_filename\n    return '/'.join(parts)\n\n\nsetup_params = dict(\n    name=\"setuptools\",\n    version=\"25.0.1\",\n    description=\"Easily download, build, install, upgrade, and uninstall \"\n        \"Python packages\",\n    author=\"Python Packaging Authority\",\n    author_email=\"distutils-sig@python.org\",\n    long_description=long_description,\n    keywords=\"CPAN PyPI distutils eggs package management\",\n    url=\"https://github.com/pypa/setuptools\",\n    src_root=None,\n    packages=setuptools.find_packages(exclude=['*.tests']),\n    package_data=package_data,\n\n    py_modules=['easy_install'],\n\n    zip_safe=True,\n\n    entry_points={\n        \"distutils.commands\": [\n            \"%(cmd)s = setuptools.command.%(cmd)s:%(cmd)s\" % locals()\n            for cmd in read_commands()\n        ],\n        \"distutils.setup_keywords\": [\n            \"eager_resources        = setuptools.dist:assert_string_list\",\n            \"namespace_packages     = setuptools.dist:check_nsp\",\n            \"extras_require         = setuptools.dist:check_extras\",\n            \"install_requires       = setuptools.dist:check_requirements\",\n            \"tests_require          = setuptools.dist:check_requirements\",\n            \"setup_requires         = setuptools.dist:check_requirements\",\n            \"python_requires        = setuptools.dist:check_specifier\",\n            \"entry_points           = setuptools.dist:check_entry_points\",\n            \"test_suite             = setuptools.dist:check_test_suite\",\n            \"zip_safe               = setuptools.dist:assert_bool\",\n            \"package_data           = setuptools.dist:check_package_data\",\n            \"exclude_package_data   = setuptools.dist:check_package_data\",\n            \"include_package_data   = setuptools.dist:assert_bool\",\n            \"packages               = setuptools.dist:check_packages\",\n            \"dependency_links       = setuptools.dist:assert_string_list\",\n            \"test_loader            = setuptools.dist:check_importable\",\n            \"test_runner            = setuptools.dist:check_importable\",\n            \"use_2to3               = setuptools.dist:assert_bool\",\n            \"convert_2to3_doctests  = setuptools.dist:assert_string_list\",\n            \"use_2to3_fixers        = setuptools.dist:assert_string_list\",\n            \"use_2to3_exclude_fixers = setuptools.dist:assert_string_list\",\n        ],\n        \"egg_info.writers\": [\n            \"PKG-INFO = setuptools.command.egg_info:write_pkg_info\",\n            \"requires.txt = setuptools.command.egg_info:write_requirements\",\n            \"entry_points.txt = setuptools.command.egg_info:write_entries\",\n            \"eager_resources.txt = setuptools.command.egg_info:overwrite_arg\",\n            \"namespace_packages.txt = setuptools.command.egg_info:overwrite_arg\",\n            \"top_level.txt = setuptools.command.egg_info:write_toplevel_names\",\n            \"depends.txt = setuptools.command.egg_info:warn_depends_obsolete\",\n            \"dependency_links.txt = setuptools.command.egg_info:overwrite_arg\",\n        ],\n        \"console_scripts\": list(_gen_console_scripts()),\n\n        \"setuptools.installation\":\n            ['eggsecutable = setuptools.command.easy_install:bootstrap'],\n    },\n\n\n    classifiers=textwrap.dedent(\"\"\"\n        Development Status :: 5 - Production/Stable\n        Intended Audience :: Developers\n        License :: OSI Approved :: MIT License\n        Operating System :: OS Independent\n        Programming Language :: Python :: 2.6\n        Programming Language :: Python :: 2.7\n        Programming Language :: Python :: 3\n        Programming Language :: Python :: 3.3\n        Programming Language :: Python :: 3.4\n        Programming Language :: Python :: 3.5\n        Topic :: Software Development :: Libraries :: Python Modules\n        Topic :: System :: Archiving :: Packaging\n        Topic :: System :: Systems Administration\n        Topic :: Utilities\n        \"\"\").strip().splitlines(),\n    extras_require={\n        \"ssl:sys_platform=='win32'\": \"wincertstore==0.2\",\n        \"certs\": \"certifi==2016.2.28\",\n    },\n    dependency_links=[\n        pypi_link(\n            'certifi-2016.2.28.tar.gz#md5=5d672aa766e1f773c75cfeccd02d3650',\n        ),\n        pypi_link(\n            'wincertstore-0.2.zip#md5=ae728f2f007185648d0c7a8679b361e2',\n        ),\n    ],\n    scripts=[],\n    tests_require=[\n        'setuptools[ssl]',\n        'pytest-flake8',\n        # workaround for pytest-flake8 #7\n        'flake8<3dev',\n        'pytest>=2.8',\n    ] + (['mock'] if sys.version_info[:2] < (3, 3) else []),\n    setup_requires=[\n    ] + pytest_runner + wheel,\n)\n\nif __name__ == '__main__':\n    # allow setup.py to run from another directory\n    here and os.path.chdir(here)\n    require_metadata()\n    dist = setuptools.setup(**setup_params)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\"\"\"\nDistutils setup file, used to install or test 'setuptools'\n\"\"\"\n\nimport io\nimport os\nimport sys\nimport textwrap\n\nimport setuptools\n\n\nhere = os.path.dirname(__file__)\n\n\ndef require_metadata():\n    \"Prevent improper installs without necessary metadata. See #659\"\n    if not os.path.exists('setuptools.egg-info'):\n        msg = \"Cannot build setuptools without metadata. Run bootstrap.py\"\n        raise RuntimeError(msg)\n\n\ndef read_commands():\n    command_ns = {}\n    cmd_module_path = 'setuptools/command/__init__.py'\n    init_path = os.path.join(here, cmd_module_path)\n    with open(init_path) as init_file:\n        exec(init_file.read(), command_ns)\n    return command_ns['__all__']\n\n\ndef _gen_console_scripts():\n    yield \"easy_install = setuptools.command.easy_install:main\"\n\n    # Gentoo distributions manage the python-version-specific scripts\n    # themselves, so those platforms define an environment variable to\n    # suppress the creation of the version-specific scripts.\n    var_names = (\n        'SETUPTOOLS_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT',\n        'DISTRIBUTE_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT',\n    )\n    if any(os.environ.get(var) not in (None, \"\", \"0\") for var in var_names):\n        return\n    yield (\"easy_install-{shortver} = setuptools.command.easy_install:main\"\n        .format(shortver=sys.version[:3]))\n\n\nreadme_path = os.path.join(here, 'README.rst')\nwith io.open(readme_path, encoding='utf-8') as readme_file:\n    long_description = readme_file.read()\n\npackage_data = dict(\n    setuptools=['script (dev).tmpl', 'script.tmpl', 'site-patch.py'],\n)\n\nforce_windows_specific_files = (\n    os.environ.get(\"SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES\")\n    not in (None, \"\", \"0\")\n)\n\ninclude_windows_files = (\n    sys.platform == 'win32' or\n    os.name == 'java' and os._name == 'nt' or\n    force_windows_specific_files\n)\n\nif include_windows_files:\n    package_data.setdefault('setuptools', []).extend(['*.exe'])\n    package_data.setdefault('setuptools.command', []).extend(['*.xml'])\n\nneeds_pytest = set(['ptr', 'pytest', 'test']).intersection(sys.argv)\npytest_runner = ['pytest-runner'] if needs_pytest else []\nneeds_wheel = set(['release', 'bdist_wheel']).intersection(sys.argv)\nwheel = ['wheel'] if needs_wheel else []\n\n\ndef pypi_link(pkg_filename):\n    \"\"\"\n    Given the filename, including md5 fragment, construct the\n    dependency link for PyPI.\n    \"\"\"\n    root = 'https://pypi.python.org/packages/source'\n    name, sep, rest = pkg_filename.partition('-')\n    parts = root, name[0], name, pkg_filename\n    return '/'.join(parts)\n\n\nsetup_params = dict(\n    name=\"setuptools\",\n    version=\"25.0.1\",\n    description=\"Easily download, build, install, upgrade, and uninstall \"\n        \"Python packages\",\n    author=\"Python Packaging Authority\",\n    author_email=\"distutils-sig@python.org\",\n    long_description=long_description,\n    keywords=\"CPAN PyPI distutils eggs package management\",\n    url=\"https://github.com/pypa/setuptools\",\n    src_root=None,\n    packages=setuptools.find_packages(exclude=['*.tests']),\n    package_data=package_data,\n\n    py_modules=['easy_install'],\n\n    zip_safe=True,\n\n    entry_points={\n        \"distutils.commands\": [\n            \"%(cmd)s = setuptools.command.%(cmd)s:%(cmd)s\" % locals()\n            for cmd in read_commands()\n        ],\n        \"distutils.setup_keywords\": [\n            \"eager_resources        = setuptools.dist:assert_string_list\",\n            \"namespace_packages     = setuptools.dist:check_nsp\",\n            \"extras_require         = setuptools.dist:check_extras\",\n            \"install_requires       = setuptools.dist:check_requirements\",\n            \"tests_require          = setuptools.dist:check_requirements\",\n            \"setup_requires         = setuptools.dist:check_requirements\",\n            \"python_requires        = setuptools.dist:check_specifier\",\n            \"entry_points           = setuptools.dist:check_entry_points\",\n            \"test_suite             = setuptools.dist:check_test_suite\",\n            \"zip_safe               = setuptools.dist:assert_bool\",\n            \"package_data           = setuptools.dist:check_package_data\",\n            \"exclude_package_data   = setuptools.dist:check_package_data\",\n            \"include_package_data   = setuptools.dist:assert_bool\",\n            \"packages               = setuptools.dist:check_packages\",\n            \"dependency_links       = setuptools.dist:assert_string_list\",\n            \"test_loader            = setuptools.dist:check_importable\",\n            \"test_runner            = setuptools.dist:check_importable\",\n            \"use_2to3               = setuptools.dist:assert_bool\",\n            \"convert_2to3_doctests  = setuptools.dist:assert_string_list\",\n            \"use_2to3_fixers        = setuptools.dist:assert_string_list\",\n            \"use_2to3_exclude_fixers = setuptools.dist:assert_string_list\",\n        ],\n        \"egg_info.writers\": [\n            \"PKG-INFO = setuptools.command.egg_info:write_pkg_info\",\n            \"requires.txt = setuptools.command.egg_info:write_requirements\",\n            \"entry_points.txt = setuptools.command.egg_info:write_entries\",\n            \"eager_resources.txt = setuptools.command.egg_info:overwrite_arg\",\n            \"namespace_packages.txt = setuptools.command.egg_info:overwrite_arg\",\n            \"top_level.txt = setuptools.command.egg_info:write_toplevel_names\",\n            \"depends.txt = setuptools.command.egg_info:warn_depends_obsolete\",\n            \"dependency_links.txt = setuptools.command.egg_info:overwrite_arg\",\n        ],\n        \"console_scripts\": list(_gen_console_scripts()),\n\n        \"setuptools.installation\":\n            ['eggsecutable = setuptools.command.easy_install:bootstrap'],\n    },\n\n\n    classifiers=textwrap.dedent(\"\"\"\n        Development Status :: 5 - Production/Stable\n        Intended Audience :: Developers\n        License :: OSI Approved :: MIT License\n        Operating System :: OS Independent\n        Programming Language :: Python :: 2.6\n        Programming Language :: Python :: 2.7\n        Programming Language :: Python :: 3\n        Programming Language :: Python :: 3.3\n        Programming Language :: Python :: 3.4\n        Programming Language :: Python :: 3.5\n        Topic :: Software Development :: Libraries :: Python Modules\n        Topic :: System :: Archiving :: Packaging\n        Topic :: System :: Systems Administration\n        Topic :: Utilities\n        \"\"\").strip().splitlines(),\n    extras_require={\n        \"ssl:sys_platform=='win32'\": \"wincertstore==0.2\",\n        \"certs\": \"certifi==2016.2.28\",\n    },\n    dependency_links=[\n        pypi_link(\n            'certifi-2016.2.28.tar.gz#md5=5d672aa766e1f773c75cfeccd02d3650',\n        ),\n        pypi_link(\n            'wincertstore-0.2.zip#md5=ae728f2f007185648d0c7a8679b361e2',\n        ),\n    ],\n    scripts=[],\n    tests_require=[\n        'setuptools[ssl]',\n        'pytest-flake8',\n        # workaround for pytest-flake8 #7\n        'flake8<3dev',\n        'pytest>=2.8',\n    ] + (['mock'] if sys.version_info[:2] < (3, 3) else []),\n    setup_requires=[\n    ] + pytest_runner + wheel,\n)\n\nif __name__ == '__main__':\n    # allow setup.py to run from another directory\n    here and os.chdir(here)\n    require_metadata()\n    dist = setuptools.setup(**setup_params)\n", "path": "setup.py"}]}