We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
installation issues with setuptools 58.5.x
## Description

I observed some failures on CI in a recent PR that appear to be related to use of setuptools >= 58.5.0. Example: https://github.com/scikit-image/scikit-image/runs/4104921276?check_suite_focus=true

I was able to reproduce the issue locally with 58.5.0, but it does not occur for 58.4.0. A temporary workaround would be to pin setuptools <58.5 on CI.



## Way to reproduce

build from source with setuptools >= 58.5



--- 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 import os
4 import sys
5 import tempfile
6 import shutil
7 import builtins
8 import textwrap
9 
10 import setuptools
11 from distutils.command.build_py import build_py
12 from distutils.command.sdist import sdist
13 from distutils.errors import CompileError, LinkError
14 from numpy.distutils.command.build_ext import build_ext
15 
16 
17 DISTNAME = 'scikit-image'
18 DESCRIPTION = 'Image processing in Python'
19 MAINTAINER = 'Stefan van der Walt'
20 MAINTAINER_EMAIL = 'stefan@sun.ac.za'
21 URL = 'https://scikit-image.org'
22 LICENSE = 'Modified BSD'
23 DOWNLOAD_URL = 'https://scikit-image.org/docs/stable/install.html'
24 PROJECT_URLS = {
25     "Bug Tracker": 'https://github.com/scikit-image/scikit-image/issues',
26     "Documentation": 'https://scikit-image.org/docs/stable/',
27     "Source Code": 'https://github.com/scikit-image/scikit-image'
28 }
29 
30 with open('README.md', encoding='utf-8') as f:
31     LONG_DESCRIPTION = f.read()
32 
33 if sys.version_info < (3, 6):
34 
35     error = """Python {py} detected.
36 
37 scikit-image 0.18+ supports only Python 3.7 and above.
38 
39 For Python 2.7, please install the 0.14.x Long Term Support release using:
40 
41  $ pip install 'scikit-image<0.15'
42 """.format(py='.'.join([str(v) for v in sys.version_info[:3]]))
43 
44     sys.stderr.write(error + "\n")
45     sys.exit(1)
46 
47 # This is a bit (!) hackish: we are setting a global variable so that the main
48 # skimage __init__ can detect if it is being loaded by the setup routine, to
49 # avoid attempting to load components that aren't built yet:
50 # the numpy distutils extensions that are used by scikit-image to recursively
51 # build the compiled extensions in sub-packages is based on the Python import
52 # machinery.
53 builtins.__SKIMAGE_SETUP__ = True
54 
55 
56 # Support for openmp
57 
58 class ConditionalOpenMP(build_ext):
59 
60     def can_compile_link(self, compile_flags, link_flags):
61 
62         if "PYODIDE_PACKAGE_ABI" in os.environ:
63             # pyodide doesn't support OpenMP
64             return False
65 
66         cc = self.compiler
67         fname = 'test.c'
68         cwd = os.getcwd()
69         tmpdir = tempfile.mkdtemp()
70 
71         code = ("#include <omp.h>"
72                 "int main(int argc, char** argv) { return(0); }")
73 
74         if self.compiler.compiler_type == "msvc":
75             # make sure we build a DLL on Windows
76             local_link_flags = link_flags + ["/DLL"]
77         else:
78             local_link_flags = link_flags
79 
80         try:
81             os.chdir(tmpdir)
82             with open(fname, 'wt') as fobj:
83                 fobj.write(code)
84             try:
85                 objects = cc.compile([fname],
86                                      extra_postargs=compile_flags)
87             except CompileError:
88                 return False
89             try:
90                 # Link shared lib rather then executable to avoid
91                 # http://bugs.python.org/issue4431 with MSVC 10+
92                 cc.link_shared_lib(objects, "testlib",
93                                    extra_postargs=local_link_flags)
94             except (LinkError, TypeError):
95                 return False
96         finally:
97             os.chdir(cwd)
98             shutil.rmtree(tmpdir)
99         return True
100 
101     def build_extensions(self):
102         """ Hook into extension building to set compiler flags """
103 
104         compile_flags = list()
105         link_flags = list()
106 
107         # check which compiler is being used
108         if self.compiler.compiler_type == "msvc":
109             # '-fopenmp' is called '/openmp' in msvc
110             compile_flags += ['/openmp']
111         else:
112             compile_flags += ['-fopenmp']
113             link_flags += ['-fopenmp']
114 
115         if self.can_compile_link(compile_flags, link_flags):
116             for ext in self.extensions:
117                 ext.extra_compile_args += compile_flags
118                 ext.extra_link_args += link_flags
119 
120         build_ext.build_extensions(self)
121 
122 
123 with open('skimage/__init__.py', encoding='utf-8') as fid:
124     for line in fid:
125         if line.startswith('__version__'):
126             VERSION = line.strip().split()[-1][1:-1]
127             break
128 
129 
130 def parse_requirements_file(filename):
131     with open(filename, encoding='utf-8') as fid:
132         requires = [line.strip() for line in fid.readlines() if line]
133 
134     return requires
135 
136 
137 INSTALL_REQUIRES = parse_requirements_file('requirements/default.txt')
138 # The `requirements/extras.txt` file is explicitely omitted because
139 # it contains requirements that do not have wheels uploaded to pip
140 # for the platforms we wish to support.
141 extras_require = {
142     dep: parse_requirements_file('requirements/' + dep + '.txt')
143     for dep in ['docs', 'optional', 'test', 'data']
144 }
145 
146 # requirements for those browsing PyPI
147 REQUIRES = [r.replace('>=', ' (>= ') + ')' for r in INSTALL_REQUIRES]
148 REQUIRES = [r.replace('==', ' (== ') for r in REQUIRES]
149 REQUIRES = [r.replace('[array]', '') for r in REQUIRES]
150 
151 
152 def configuration(parent_package='', top_path=None):
153     if os.path.exists('MANIFEST'):
154         os.remove('MANIFEST')
155 
156     from numpy.distutils.misc_util import Configuration
157     config = Configuration(None, parent_package, top_path)
158 
159     config.set_options(
160         ignore_setup_xxx_py=True,
161         assume_default_configuration=True,
162         delegate_options_to_subpackages=True,
163         quiet=True)
164 
165     config.add_subpackage('skimage')
166 
167     return config
168 
169 
170 if __name__ == "__main__":
171     cmdclass = {'build_py': build_py,
172                 'sdist': sdist}
173     try:
174         # test if build dependencies exist.
175         # if not, some commands are still viable.
176         # note: this must be kept in sync with pyproject.toml
177         from numpy.distutils.core import setup
178         import cython
179         extra = {'configuration': configuration}
180         cmdclass['build_ext'] = ConditionalOpenMP
181     except ImportError:
182         if len(sys.argv) >= 2 and ('--help' in sys.argv[1:] or
183                                    sys.argv[1] in ('--help-commands',
184                                                    '--version',
185                                                    'clean',
186                                                    'egg_info',
187                                                    'install_egg_info',
188                                                    'rotate',
189                                                    'sdist')):
190             # For these actions, compilation is not required.
191             #
192             # They are required to succeed for example when pip is
193             # used to install scikit-image when Numpy/cython are not
194             # yet present in the system.
195             from setuptools import setup
196             extra = {}
197         else:
198             print(textwrap.dedent("""
199                 To install scikit-image from source, you will need NumPy
200                 and Cython.
201                 Install NumPy and Cython with your python package manager.
202                 If you are using pip, the commands are:
203 
204                   pip install numpy cython
205 
206                 For more details, see:
207 
208                    https://scikit-image.org/docs/stable/install.html
209             """))
210             sys.exit(1)
211 
212     setup(
213         name=DISTNAME,
214         description=DESCRIPTION,
215         long_description=LONG_DESCRIPTION,
216         long_description_content_type="text/markdown",
217         maintainer=MAINTAINER,
218         maintainer_email=MAINTAINER_EMAIL,
219         url=URL,
220         license=LICENSE,
221         download_url=DOWNLOAD_URL,
222         project_urls=PROJECT_URLS,
223         version=VERSION,
224         classifiers=[
225             'Development Status :: 4 - Beta',
226             'Environment :: Console',
227             'Intended Audience :: Developers',
228             'Intended Audience :: Science/Research',
229             'License :: OSI Approved :: BSD License',
230             'Programming Language :: C',
231             'Programming Language :: Python',
232             'Programming Language :: Python :: 3',
233             'Programming Language :: Python :: 3.7',
234             'Programming Language :: Python :: 3.8',
235             'Programming Language :: Python :: 3.9',
236             'Programming Language :: Python :: 3 :: Only',
237             'Topic :: Scientific/Engineering',
238             'Operating System :: Microsoft :: Windows',
239             'Operating System :: POSIX',
240             'Operating System :: Unix',
241             'Operating System :: MacOS',
242         ],
243         install_requires=INSTALL_REQUIRES,
244         requires=REQUIRES,
245         extras_require=extras_require,
246         python_requires='>=3.7',
247         packages=setuptools.find_packages(exclude=['doc', 'benchmarks']),
248         include_package_data=True,
249         zip_safe=False,  # the package can run out of an .egg file
250         entry_points={
251             'console_scripts': ['skivi = skimage.scripts.skivi:main'],
252         },
253         cmdclass=cmdclass,
254         **extra
255     )
256
```
--- 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
@@ -8,8 +8,8 @@
 import textwrap
 
 import setuptools
-from distutils.command.build_py import build_py
-from distutils.command.sdist import sdist
+from setuptools.command.build_py import build_py
+from setuptools.command.sdist import sdist
 from distutils.errors import CompileError, LinkError
 from numpy.distutils.command.build_ext import build_ext

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -8,8 +8,8 @@\n import textwrap\n \n import setuptools\n-from distutils.command.build_py import build_py\n-from distutils.command.sdist import sdist\n+from setuptools.command.build_py import build_py\n+from setuptools.command.sdist import sdist\n from distutils.errors import CompileError, LinkError\n from numpy.distutils.command.build_ext import build_ext\n", "issue": "installation issues with setuptools 58.5.x\n## Description\r\n\r\nI observed some failures on CI in a recent PR that appear to be related to use of setuptools >= 58.5.0. Example: https://github.com/scikit-image/scikit-image/runs/4104921276?check_suite_focus=true\r\n\r\nI was able to reproduce the issue locally with 58.5.0, but it does not occur for 58.4.0. A temporary workaround would be to pin setuptools <58.5 on CI.\r\n\r\n\r\n\r\n## Way to reproduce\r\n\r\nbuild from source with setuptools >= 58.5\r\n\r\n\n", "before_files": [{"content": "#! /usr/bin/env python\n\nimport os\nimport sys\nimport tempfile\nimport shutil\nimport builtins\nimport textwrap\n\nimport setuptools\nfrom distutils.command.build_py import build_py\nfrom distutils.command.sdist import sdist\nfrom distutils.errors import CompileError, LinkError\nfrom numpy.distutils.command.build_ext import build_ext\n\n\nDISTNAME = 'scikit-image'\nDESCRIPTION = 'Image processing in Python'\nMAINTAINER = 'Stefan van der Walt'\nMAINTAINER_EMAIL = 'stefan@sun.ac.za'\nURL = 'https://scikit-image.org'\nLICENSE = 'Modified BSD'\nDOWNLOAD_URL = 'https://scikit-image.org/docs/stable/install.html'\nPROJECT_URLS = {\n    \"Bug Tracker\": 'https://github.com/scikit-image/scikit-image/issues',\n    \"Documentation\": 'https://scikit-image.org/docs/stable/',\n    \"Source Code\": 'https://github.com/scikit-image/scikit-image'\n}\n\nwith open('README.md', encoding='utf-8') as f:\n    LONG_DESCRIPTION = f.read()\n\nif sys.version_info < (3, 6):\n\n    error = \"\"\"Python {py} detected.\n\nscikit-image 0.18+ supports only Python 3.7 and above.\n\nFor Python 2.7, please install the 0.14.x Long Term Support release using:\n\n $ pip install 'scikit-image<0.15'\n\"\"\".format(py='.'.join([str(v) for v in sys.version_info[:3]]))\n\n    sys.stderr.write(error + \"\\n\")\n    sys.exit(1)\n\n# This is a bit (!) hackish: we are setting a global variable so that the main\n# skimage __init__ can detect if it is being loaded by the setup routine, to\n# avoid attempting to load components that aren't built yet:\n# the numpy distutils extensions that are used by scikit-image to recursively\n# build the compiled extensions in sub-packages is based on the Python import\n# machinery.\nbuiltins.__SKIMAGE_SETUP__ = True\n\n\n# Support for openmp\n\nclass ConditionalOpenMP(build_ext):\n\n    def can_compile_link(self, compile_flags, link_flags):\n\n        if \"PYODIDE_PACKAGE_ABI\" in os.environ:\n            # pyodide doesn't support OpenMP\n            return False\n\n        cc = self.compiler\n        fname = 'test.c'\n        cwd = os.getcwd()\n        tmpdir = tempfile.mkdtemp()\n\n        code = (\"#include <omp.h>\"\n                \"int main(int argc, char** argv) { return(0); }\")\n\n        if self.compiler.compiler_type == \"msvc\":\n            # make sure we build a DLL on Windows\n            local_link_flags = link_flags + [\"/DLL\"]\n        else:\n            local_link_flags = link_flags\n\n        try:\n            os.chdir(tmpdir)\n            with open(fname, 'wt') as fobj:\n                fobj.write(code)\n            try:\n                objects = cc.compile([fname],\n                                     extra_postargs=compile_flags)\n            except CompileError:\n                return False\n            try:\n                # Link shared lib rather then executable to avoid\n                # http://bugs.python.org/issue4431 with MSVC 10+\n                cc.link_shared_lib(objects, \"testlib\",\n                                   extra_postargs=local_link_flags)\n            except (LinkError, TypeError):\n                return False\n        finally:\n            os.chdir(cwd)\n            shutil.rmtree(tmpdir)\n        return True\n\n    def build_extensions(self):\n        \"\"\" Hook into extension building to set compiler flags \"\"\"\n\n        compile_flags = list()\n        link_flags = list()\n\n        # check which compiler is being used\n        if self.compiler.compiler_type == \"msvc\":\n            # '-fopenmp' is called '/openmp' in msvc\n            compile_flags += ['/openmp']\n        else:\n            compile_flags += ['-fopenmp']\n            link_flags += ['-fopenmp']\n\n        if self.can_compile_link(compile_flags, link_flags):\n            for ext in self.extensions:\n                ext.extra_compile_args += compile_flags\n                ext.extra_link_args += link_flags\n\n        build_ext.build_extensions(self)\n\n\nwith open('skimage/__init__.py', encoding='utf-8') as fid:\n    for line in fid:\n        if line.startswith('__version__'):\n            VERSION = line.strip().split()[-1][1:-1]\n            break\n\n\ndef parse_requirements_file(filename):\n    with open(filename, encoding='utf-8') as fid:\n        requires = [line.strip() for line in fid.readlines() if line]\n\n    return requires\n\n\nINSTALL_REQUIRES = parse_requirements_file('requirements/default.txt')\n# The `requirements/extras.txt` file is explicitely omitted because\n# it contains requirements that do not have wheels uploaded to pip\n# for the platforms we wish to support.\nextras_require = {\n    dep: parse_requirements_file('requirements/' + dep + '.txt')\n    for dep in ['docs', 'optional', 'test', 'data']\n}\n\n# requirements for those browsing PyPI\nREQUIRES = [r.replace('>=', ' (>= ') + ')' for r in INSTALL_REQUIRES]\nREQUIRES = [r.replace('==', ' (== ') for r in REQUIRES]\nREQUIRES = [r.replace('[array]', '') for r in REQUIRES]\n\n\ndef configuration(parent_package='', top_path=None):\n    if os.path.exists('MANIFEST'):\n        os.remove('MANIFEST')\n\n    from numpy.distutils.misc_util import Configuration\n    config = Configuration(None, parent_package, top_path)\n\n    config.set_options(\n        ignore_setup_xxx_py=True,\n        assume_default_configuration=True,\n        delegate_options_to_subpackages=True,\n        quiet=True)\n\n    config.add_subpackage('skimage')\n\n    return config\n\n\nif __name__ == \"__main__\":\n    cmdclass = {'build_py': build_py,\n                'sdist': sdist}\n    try:\n        # test if build dependencies exist.\n        # if not, some commands are still viable.\n        # note: this must be kept in sync with pyproject.toml\n        from numpy.distutils.core import setup\n        import cython\n        extra = {'configuration': configuration}\n        cmdclass['build_ext'] = ConditionalOpenMP\n    except ImportError:\n        if len(sys.argv) >= 2 and ('--help' in sys.argv[1:] or\n                                   sys.argv[1] in ('--help-commands',\n                                                   '--version',\n                                                   'clean',\n                                                   'egg_info',\n                                                   'install_egg_info',\n                                                   'rotate',\n                                                   'sdist')):\n            # For these actions, compilation is not required.\n            #\n            # They are required to succeed for example when pip is\n            # used to install scikit-image when Numpy/cython are not\n            # yet present in the system.\n            from setuptools import setup\n            extra = {}\n        else:\n            print(textwrap.dedent(\"\"\"\n                To install scikit-image from source, you will need NumPy\n                and Cython.\n                Install NumPy and Cython with your python package manager.\n                If you are using pip, the commands are:\n\n                  pip install numpy cython\n\n                For more details, see:\n\n                   https://scikit-image.org/docs/stable/install.html\n            \"\"\"))\n            sys.exit(1)\n\n    setup(\n        name=DISTNAME,\n        description=DESCRIPTION,\n        long_description=LONG_DESCRIPTION,\n        long_description_content_type=\"text/markdown\",\n        maintainer=MAINTAINER,\n        maintainer_email=MAINTAINER_EMAIL,\n        url=URL,\n        license=LICENSE,\n        download_url=DOWNLOAD_URL,\n        project_urls=PROJECT_URLS,\n        version=VERSION,\n        classifiers=[\n            'Development Status :: 4 - Beta',\n            'Environment :: Console',\n            'Intended Audience :: Developers',\n            'Intended Audience :: Science/Research',\n            'License :: OSI Approved :: BSD License',\n            'Programming Language :: C',\n            'Programming Language :: Python',\n            'Programming Language :: Python :: 3',\n            'Programming Language :: Python :: 3.7',\n            'Programming Language :: Python :: 3.8',\n            'Programming Language :: Python :: 3.9',\n            'Programming Language :: Python :: 3 :: Only',\n            'Topic :: Scientific/Engineering',\n            'Operating System :: Microsoft :: Windows',\n            'Operating System :: POSIX',\n            'Operating System :: Unix',\n            'Operating System :: MacOS',\n        ],\n        install_requires=INSTALL_REQUIRES,\n        requires=REQUIRES,\n        extras_require=extras_require,\n        python_requires='>=3.7',\n        packages=setuptools.find_packages(exclude=['doc', 'benchmarks']),\n        include_package_data=True,\n        zip_safe=False,  # the package can run out of an .egg file\n        entry_points={\n            'console_scripts': ['skivi = skimage.scripts.skivi:main'],\n        },\n        cmdclass=cmdclass,\n        **extra\n    )\n", "path": "setup.py"}], "after_files": [{"content": "#! /usr/bin/env python\n\nimport os\nimport sys\nimport tempfile\nimport shutil\nimport builtins\nimport textwrap\n\nimport setuptools\nfrom setuptools.command.build_py import build_py\nfrom setuptools.command.sdist import sdist\nfrom distutils.errors import CompileError, LinkError\nfrom numpy.distutils.command.build_ext import build_ext\n\n\nDISTNAME = 'scikit-image'\nDESCRIPTION = 'Image processing in Python'\nMAINTAINER = 'Stefan van der Walt'\nMAINTAINER_EMAIL = 'stefan@sun.ac.za'\nURL = 'https://scikit-image.org'\nLICENSE = 'Modified BSD'\nDOWNLOAD_URL = 'https://scikit-image.org/docs/stable/install.html'\nPROJECT_URLS = {\n    \"Bug Tracker\": 'https://github.com/scikit-image/scikit-image/issues',\n    \"Documentation\": 'https://scikit-image.org/docs/stable/',\n    \"Source Code\": 'https://github.com/scikit-image/scikit-image'\n}\n\nwith open('README.md', encoding='utf-8') as f:\n    LONG_DESCRIPTION = f.read()\n\nif sys.version_info < (3, 6):\n\n    error = \"\"\"Python {py} detected.\n\nscikit-image 0.18+ supports only Python 3.7 and above.\n\nFor Python 2.7, please install the 0.14.x Long Term Support release using:\n\n $ pip install 'scikit-image<0.15'\n\"\"\".format(py='.'.join([str(v) for v in sys.version_info[:3]]))\n\n    sys.stderr.write(error + \"\\n\")\n    sys.exit(1)\n\n# This is a bit (!) hackish: we are setting a global variable so that the main\n# skimage __init__ can detect if it is being loaded by the setup routine, to\n# avoid attempting to load components that aren't built yet:\n# the numpy distutils extensions that are used by scikit-image to recursively\n# build the compiled extensions in sub-packages is based on the Python import\n# machinery.\nbuiltins.__SKIMAGE_SETUP__ = True\n\n\n# Support for openmp\n\nclass ConditionalOpenMP(build_ext):\n\n    def can_compile_link(self, compile_flags, link_flags):\n\n        if \"PYODIDE_PACKAGE_ABI\" in os.environ:\n            # pyodide doesn't support OpenMP\n            return False\n\n        cc = self.compiler\n        fname = 'test.c'\n        cwd = os.getcwd()\n        tmpdir = tempfile.mkdtemp()\n\n        code = (\"#include <omp.h>\"\n                \"int main(int argc, char** argv) { return(0); }\")\n\n        if self.compiler.compiler_type == \"msvc\":\n            # make sure we build a DLL on Windows\n            local_link_flags = link_flags + [\"/DLL\"]\n        else:\n            local_link_flags = link_flags\n\n        try:\n            os.chdir(tmpdir)\n            with open(fname, 'wt') as fobj:\n                fobj.write(code)\n            try:\n                objects = cc.compile([fname],\n                                     extra_postargs=compile_flags)\n            except CompileError:\n                return False\n            try:\n                # Link shared lib rather then executable to avoid\n                # http://bugs.python.org/issue4431 with MSVC 10+\n                cc.link_shared_lib(objects, \"testlib\",\n                                   extra_postargs=local_link_flags)\n            except (LinkError, TypeError):\n                return False\n        finally:\n            os.chdir(cwd)\n            shutil.rmtree(tmpdir)\n        return True\n\n    def build_extensions(self):\n        \"\"\" Hook into extension building to set compiler flags \"\"\"\n\n        compile_flags = list()\n        link_flags = list()\n\n        # check which compiler is being used\n        if self.compiler.compiler_type == \"msvc\":\n            # '-fopenmp' is called '/openmp' in msvc\n            compile_flags += ['/openmp']\n        else:\n            compile_flags += ['-fopenmp']\n            link_flags += ['-fopenmp']\n\n        if self.can_compile_link(compile_flags, link_flags):\n            for ext in self.extensions:\n                ext.extra_compile_args += compile_flags\n                ext.extra_link_args += link_flags\n\n        build_ext.build_extensions(self)\n\n\nwith open('skimage/__init__.py', encoding='utf-8') as fid:\n    for line in fid:\n        if line.startswith('__version__'):\n            VERSION = line.strip().split()[-1][1:-1]\n            break\n\n\ndef parse_requirements_file(filename):\n    with open(filename, encoding='utf-8') as fid:\n        requires = [line.strip() for line in fid.readlines() if line]\n\n    return requires\n\n\nINSTALL_REQUIRES = parse_requirements_file('requirements/default.txt')\n# The `requirements/extras.txt` file is explicitely omitted because\n# it contains requirements that do not have wheels uploaded to pip\n# for the platforms we wish to support.\nextras_require = {\n    dep: parse_requirements_file('requirements/' + dep + '.txt')\n    for dep in ['docs', 'optional', 'test', 'data']\n}\n\n# requirements for those browsing PyPI\nREQUIRES = [r.replace('>=', ' (>= ') + ')' for r in INSTALL_REQUIRES]\nREQUIRES = [r.replace('==', ' (== ') for r in REQUIRES]\nREQUIRES = [r.replace('[array]', '') for r in REQUIRES]\n\n\ndef configuration(parent_package='', top_path=None):\n    if os.path.exists('MANIFEST'):\n        os.remove('MANIFEST')\n\n    from numpy.distutils.misc_util import Configuration\n    config = Configuration(None, parent_package, top_path)\n\n    config.set_options(\n        ignore_setup_xxx_py=True,\n        assume_default_configuration=True,\n        delegate_options_to_subpackages=True,\n        quiet=True)\n\n    config.add_subpackage('skimage')\n\n    return config\n\n\nif __name__ == \"__main__\":\n    cmdclass = {'build_py': build_py,\n                'sdist': sdist}\n    try:\n        # test if build dependencies exist.\n        # if not, some commands are still viable.\n        # note: this must be kept in sync with pyproject.toml\n        from numpy.distutils.core import setup\n        import cython\n        extra = {'configuration': configuration}\n        cmdclass['build_ext'] = ConditionalOpenMP\n    except ImportError:\n        if len(sys.argv) >= 2 and ('--help' in sys.argv[1:] or\n                                   sys.argv[1] in ('--help-commands',\n                                                   '--version',\n                                                   'clean',\n                                                   'egg_info',\n                                                   'install_egg_info',\n                                                   'rotate',\n                                                   'sdist')):\n            # For these actions, compilation is not required.\n            #\n            # They are required to succeed for example when pip is\n            # used to install scikit-image when Numpy/cython are not\n            # yet present in the system.\n            from setuptools import setup\n            extra = {}\n        else:\n            print(textwrap.dedent(\"\"\"\n                To install scikit-image from source, you will need NumPy\n                and Cython.\n                Install NumPy and Cython with your python package manager.\n                If you are using pip, the commands are:\n\n                  pip install numpy cython\n\n                For more details, see:\n\n                   https://scikit-image.org/docs/stable/install.html\n            \"\"\"))\n            sys.exit(1)\n\n    setup(\n        name=DISTNAME,\n        description=DESCRIPTION,\n        long_description=LONG_DESCRIPTION,\n        long_description_content_type=\"text/markdown\",\n        maintainer=MAINTAINER,\n        maintainer_email=MAINTAINER_EMAIL,\n        url=URL,\n        license=LICENSE,\n        download_url=DOWNLOAD_URL,\n        project_urls=PROJECT_URLS,\n        version=VERSION,\n        classifiers=[\n            'Development Status :: 4 - Beta',\n            'Environment :: Console',\n            'Intended Audience :: Developers',\n            'Intended Audience :: Science/Research',\n            'License :: OSI Approved :: BSD License',\n            'Programming Language :: C',\n            'Programming Language :: Python',\n            'Programming Language :: Python :: 3',\n            'Programming Language :: Python :: 3.7',\n            'Programming Language :: Python :: 3.8',\n            'Programming Language :: Python :: 3.9',\n            'Programming Language :: Python :: 3 :: Only',\n            'Topic :: Scientific/Engineering',\n            'Operating System :: Microsoft :: Windows',\n            'Operating System :: POSIX',\n            'Operating System :: Unix',\n            'Operating System :: MacOS',\n        ],\n        install_requires=INSTALL_REQUIRES,\n        requires=REQUIRES,\n        extras_require=extras_require,\n        python_requires='>=3.7',\n        packages=setuptools.find_packages(exclude=['doc', 'benchmarks']),\n        include_package_data=True,\n        zip_safe=False,  # the package can run out of an .egg file\n        entry_points={\n            'console_scripts': ['skivi = skimage.scripts.skivi:main'],\n        },\n        cmdclass=cmdclass,\n        **extra\n    )\n", "path": "setup.py"}]}