We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Problems with setup.py when failures arise
I'm seeing the following error on Linux using Python 3.7.  FWIW, the underlying error is that the PyUtilib master branch hasn't been installed, which is now required to install the Pyomo master branch:

> Traceback (most recent call last):
>   File "/home/wehart/anaconda3/envs/simple/lib/python3.7/distutils/core.py", line 148, in setup
>     dist.run_commands()
>   File "/home/wehart/anaconda3/envs/simple/lib/python3.7/distutils/dist.py", line 966, in run_commands
>     self.run_command(cmd)
>   File "/home/wehart/anaconda3/envs/simple/lib/python3.7/distutils/dist.py", line 985, in run_command
>     cmd_obj.run()
>   File "/home/wehart/anaconda3/envs/simple/lib/python3.7/site-packages/setuptools/command/develop.py", line 38, in run
>     self.install_for_development()
>   File "/home/wehart/anaconda3/envs/simple/lib/python3.7/site-packages/setuptools/command/develop.py", line 154, in install_for_development
>     self.process_distribution(None, self.dist, not self.no_deps)
>   File "/home/wehart/anaconda3/envs/simple/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 752, in process_distribution
>     [requirement], self.local_index, self.easy_install
>   File "/home/wehart/anaconda3/envs/simple/lib/python3.7/site-packages/pkg_resources/__init__.py", line 780, in resolve
>     replace_conflicting=replace_conflicting
>   File "/home/wehart/anaconda3/envs/simple/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1063, in best_match
>     return self.obtain(req, installer)
>   File "/home/wehart/anaconda3/envs/simple/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1075, in obtain
>     return installer(requirement)
>   File "/home/wehart/anaconda3/envs/simple/lib/python3.7/site-packages/setuptools/command/easy_install.py", line 673, in easy_install
>     raise DistutilsError(msg)
> distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('PyUtilib>=5.6.6.dev0')
> 
> During handling of the above exception, another exception occurred:
> 
> Traceback (most recent call last):
>   File "setup.py", line 191, in <module>
>     run_setup()
>   File "setup.py", line 187, in run_setup
>     """
>   File "/home/wehart/anaconda3/envs/simple/lib/python3.7/site-packages/setuptools/__init__.py", line 143, in setup
>     return distutils.core.setup(**attrs)
>   File "/home/wehart/anaconda3/envs/simple/lib/python3.7/distutils/core.py", line 163, in setup
>     raise SystemExit("error: " + str(msg))
> SystemExit: error: Could not find suitable distribution for Requirement.parse('PyUtilib>=5.6.6.dev0')
> 
> During handling of the above exception, another exception occurred:
> 
> Traceback (most recent call last):
>   File "setup.py", line 197, in <module>
>     if 'Microsoft Visual C++' not in e_info.message:
> AttributeError: 'SystemExit' object has no attribute 'message'


--- 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 #  ___________________________________________________________________________
2 #
3 #  Pyomo: Python Optimization Modeling Objects
4 #  Copyright 2017 National Technology and Engineering Solutions of Sandia, LLC
5 #  Under the terms of Contract DE-NA0003525 with National Technology and
6 #  Engineering Solutions of Sandia, LLC, the U.S. Government retains certain
7 #  rights in this software.
8 #  This software is distributed under the 3-clause BSD License.
9 #  ___________________________________________________________________________
10 
11 """
12 Script to generate the installer for pyomo.
13 """
14 
15 import sys
16 import os
17 
18 
19 def _find_packages(path):
20     """
21     Generate a list of nested packages
22     """
23     pkg_list = []
24     if not os.path.exists(path):
25         return []
26     if not os.path.exists(path+os.sep+"__init__.py"):
27         return []
28     else:
29         pkg_list.append(path)
30     for root, dirs, files in os.walk(path, topdown=True):
31         if root in pkg_list and "__init__.py" in files:
32             for name in dirs:
33                 if os.path.exists(root+os.sep+name+os.sep+"__init__.py"):
34                     pkg_list.append(root+os.sep+name)
35     return [pkg for pkg in map(lambda x:x.replace(os.sep, "."), pkg_list)]
36 
37 
38 def read(*rnames):
39     return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
40 
41 requires = [
42     'PyUtilib>=5.6.6.dev0',
43     'appdirs',
44     'ply',
45     'six>=1.4',
46     ]
47 if sys.version_info < (2, 7):
48     requires.append('argparse')
49     requires.append('unittest2')
50     requires.append('ordereddict')
51 
52 from setuptools import setup
53 import sys
54 
55 CYTHON_REQUIRED = "required"
56 if 'develop' in sys.argv:
57     using_cython = False
58 else:
59     using_cython = "automatic"
60 if '--with-cython' in sys.argv:
61     using_cython = CYTHON_REQUIRED
62     sys.argv.remove('--with-cython')
63 if '--without-cython' in sys.argv:
64     using_cython = False
65     sys.argv.remove('--without-cython')
66 
67 ext_modules = []
68 if using_cython:
69     try:
70         import platform
71         if platform.python_implementation() != "CPython":
72             # break out of this try-except (disable Cython)
73             raise RuntimeError("Cython is only supported under CPython")
74         from Cython.Build import cythonize
75         #
76         # Note: The Cython developers recommend that you destribute C source
77         # files to users.  But this is fine for evaluating the utility of Cython
78         #
79         import shutil
80         files = [
81             "pyomo/core/expr/expr_pyomo5.pyx",
82             "pyomo/core/expr/numvalue.pyx",
83             "pyomo/core/util.pyx",
84             "pyomo/repn/standard_repn.pyx",
85             "pyomo/repn/plugins/cpxlp.pyx",
86             "pyomo/repn/plugins/gams_writer.pyx",
87             "pyomo/repn/plugins/baron_writer.pyx",
88             "pyomo/repn/plugins/ampl/ampl_.pyx",
89         ]
90         for f in files:
91             shutil.copyfile(f[:-1], f)
92         ext_modules = cythonize(files)
93     except:
94         if using_cython == CYTHON_REQUIRED:
95             print("""
96 ERROR: Cython was explicitly requested with --with-cython, but cythonization
97        of core Pyomo modules failed.
98 """)
99             raise
100         using_cython = False
101 
102 packages = _find_packages('pyomo')
103 
104 def run_setup():
105    setup(name='Pyomo',
106       #
107       # Note: trunk should have *next* major.minor
108       #     VOTD and Final releases will have major.minor.revnum
109       #
110       # When cutting a release, ALSO update _major/_minor/_revnum in
111       #
112       #     pyomo/pyomo/version/__init__.py
113       #     pyomo/RELEASE.txt
114       #
115       version='5.6.2.dev0',
116       maintainer='William E. Hart',
117       maintainer_email='wehart@sandia.gov',
118       url='http://pyomo.org',
119       license='BSD',
120       platforms=["any"],
121       description='Pyomo: Python Optimization Modeling Objects',
122       long_description=read('README.txt'),
123       classifiers=[
124         'Development Status :: 5 - Production/Stable',
125         'Intended Audience :: End Users/Desktop',
126         'Intended Audience :: Science/Research',
127         'License :: OSI Approved :: BSD License',
128         'Natural Language :: English',
129         'Operating System :: MacOS',
130         'Operating System :: Microsoft :: Windows',
131         'Operating System :: Unix',
132         'Programming Language :: Python',
133         'Programming Language :: Python :: 2',
134         'Programming Language :: Python :: 2.7',
135         'Programming Language :: Python :: 3',
136         'Programming Language :: Python :: 3.4',
137         'Programming Language :: Python :: 3.5',
138         'Programming Language :: Python :: 3.6',
139         'Programming Language :: Python :: 3.7',
140         'Programming Language :: Python :: Implementation :: CPython',
141         'Programming Language :: Python :: Implementation :: Jython',
142         'Programming Language :: Python :: Implementation :: PyPy',
143         'Topic :: Scientific/Engineering :: Mathematics',
144         'Topic :: Software Development :: Libraries :: Python Modules' ],
145       packages=packages,
146       keywords=['optimization'],
147       install_requires=requires,
148       ext_modules = ext_modules,
149       python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
150       entry_points="""
151         [console_scripts]
152         runbenders=pyomo.pysp.benders:Benders_main
153         evaluate_xhat=pyomo.pysp.evaluate_xhat:EvaluateXhat_main
154         runph=pyomo.pysp.phinit:PH_main
155         runef=pyomo.pysp.ef_writer_script:main
156         phsolverserver=pyomo.pysp.phsolverserver:main
157         scenariotreeserver=pyomo.pysp.scenariotree.server_pyro:main
158         computeconf=pyomo.pysp.computeconf:main
159 
160         results_schema=pyomo.scripting.commands:results_schema
161         pyro_mip_server = pyomo.scripting.pyro_mip_server:main
162         test.pyomo = pyomo.scripting.runtests:runPyomoTests
163         pyomo = pyomo.scripting.pyomo_main:main
164         pyomo_ns = pyomo.scripting.commands:pyomo_ns
165         pyomo_nsc = pyomo.scripting.commands:pyomo_nsc
166         kill_pyro_mip_servers = pyomo.scripting.commands:kill_pyro_mip_servers
167         launch_pyro_mip_servers = pyomo.scripting.commands:launch_pyro_mip_servers
168         readsol = pyomo.scripting.commands:readsol
169         OSSolverService = pyomo.scripting.commands:OSSolverService
170         pyomo_python = pyomo.scripting.commands:pyomo_python
171         pyomo_old=pyomo.scripting.pyomo_command:main
172         get_pyomo_extras = scripts.get_pyomo_extras:main
173 
174         [pyomo.command]
175         pyomo.runbenders=pyomo.pysp.benders
176         pyomo.evaluate_xhat=pyomo.pysp.evaluate_xhat
177         pyomo.runph=pyomo.pysp.phinit
178         pyomo.runef=pyomo.pysp.ef_writer_script
179         pyomo.phsolverserver=pyomo.pysp.phsolverserver
180         pyomo.scenariotreeserver=pyomo.pysp.scenariotree.server_pyro
181         pyomo.computeconf=pyomo.pysp.computeconf
182 
183         pyomo.help = pyomo.scripting.driver_help
184         pyomo.test.pyomo = pyomo.scripting.runtests
185         pyomo.pyro_mip_server = pyomo.scripting.pyro_mip_server
186         pyomo.results_schema=pyomo.scripting.commands
187       """
188       )
189 
190 try:
191     run_setup()
192 except SystemExit as e_info:
193     # Cython can generate a SystemExit exception on Windows if the
194     # environment is missing / has an incorrect Microsoft compiler.
195     # Since Cython is not strictly required, we will disable Cython and
196     # try re-running setup(), but only for this very specific situation.
197     if 'Microsoft Visual C++' not in e_info.message:
198         raise
199     elif using_cython == CYTHON_REQUIRED:
200         print("""
201 ERROR: Cython was explicitly requested with --with-cython, but cythonization
202        of core Pyomo modules failed.
203 """)
204         raise
205     else:
206         print("""
207 ERROR: setup() failed:
208     %s
209 Re-running setup() without the Cython modules
210 """ % (e_info.message,))
211         ext_modules = []
212         run_setup()
213         print("""
214 WARNING: Installation completed successfully, but the attempt to cythonize
215          core Pyomo modules failed.  Cython provides performance
216          optimizations and is not required for any Pyomo functionality.
217          Cython returned the following error:
218    "%s"
219 """ % (e_info.message,))
220
```
--- 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
@@ -194,7 +194,7 @@
     # environment is missing / has an incorrect Microsoft compiler.
     # Since Cython is not strictly required, we will disable Cython and
     # try re-running setup(), but only for this very specific situation.
-    if 'Microsoft Visual C++' not in e_info.message:
+    if 'Microsoft Visual C++' not in str(e_info):
         raise
     elif using_cython == CYTHON_REQUIRED:
         print("""

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -194,7 +194,7 @@\n     # environment is missing / has an incorrect Microsoft compiler.\n     # Since Cython is not strictly required, we will disable Cython and\n     # try re-running setup(), but only for this very specific situation.\n-    if 'Microsoft Visual C++' not in e_info.message:\n+    if 'Microsoft Visual C++' not in str(e_info):\n         raise\n     elif using_cython == CYTHON_REQUIRED:\n         print(\"\"\"\n", "issue": "Problems with setup.py when failures arise\nI'm seeing the following error on Linux using Python 3.7.  FWIW, the underlying error is that the PyUtilib master branch hasn't been installed, which is now required to install the Pyomo master branch:\r\n\r\n> Traceback (most recent call last):\r\n>   File \"/home/wehart/anaconda3/envs/simple/lib/python3.7/distutils/core.py\", line 148, in setup\r\n>     dist.run_commands()\r\n>   File \"/home/wehart/anaconda3/envs/simple/lib/python3.7/distutils/dist.py\", line 966, in run_commands\r\n>     self.run_command(cmd)\r\n>   File \"/home/wehart/anaconda3/envs/simple/lib/python3.7/distutils/dist.py\", line 985, in run_command\r\n>     cmd_obj.run()\r\n>   File \"/home/wehart/anaconda3/envs/simple/lib/python3.7/site-packages/setuptools/command/develop.py\", line 38, in run\r\n>     self.install_for_development()\r\n>   File \"/home/wehart/anaconda3/envs/simple/lib/python3.7/site-packages/setuptools/command/develop.py\", line 154, in install_for_development\r\n>     self.process_distribution(None, self.dist, not self.no_deps)\r\n>   File \"/home/wehart/anaconda3/envs/simple/lib/python3.7/site-packages/setuptools/command/easy_install.py\", line 752, in process_distribution\r\n>     [requirement], self.local_index, self.easy_install\r\n>   File \"/home/wehart/anaconda3/envs/simple/lib/python3.7/site-packages/pkg_resources/__init__.py\", line 780, in resolve\r\n>     replace_conflicting=replace_conflicting\r\n>   File \"/home/wehart/anaconda3/envs/simple/lib/python3.7/site-packages/pkg_resources/__init__.py\", line 1063, in best_match\r\n>     return self.obtain(req, installer)\r\n>   File \"/home/wehart/anaconda3/envs/simple/lib/python3.7/site-packages/pkg_resources/__init__.py\", line 1075, in obtain\r\n>     return installer(requirement)\r\n>   File \"/home/wehart/anaconda3/envs/simple/lib/python3.7/site-packages/setuptools/command/easy_install.py\", line 673, in easy_install\r\n>     raise DistutilsError(msg)\r\n> distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('PyUtilib>=5.6.6.dev0')\r\n> \r\n> During handling of the above exception, another exception occurred:\r\n> \r\n> Traceback (most recent call last):\r\n>   File \"setup.py\", line 191, in <module>\r\n>     run_setup()\r\n>   File \"setup.py\", line 187, in run_setup\r\n>     \"\"\"\r\n>   File \"/home/wehart/anaconda3/envs/simple/lib/python3.7/site-packages/setuptools/__init__.py\", line 143, in setup\r\n>     return distutils.core.setup(**attrs)\r\n>   File \"/home/wehart/anaconda3/envs/simple/lib/python3.7/distutils/core.py\", line 163, in setup\r\n>     raise SystemExit(\"error: \" + str(msg))\r\n> SystemExit: error: Could not find suitable distribution for Requirement.parse('PyUtilib>=5.6.6.dev0')\r\n> \r\n> During handling of the above exception, another exception occurred:\r\n> \r\n> Traceback (most recent call last):\r\n>   File \"setup.py\", line 197, in <module>\r\n>     if 'Microsoft Visual C++' not in e_info.message:\r\n> AttributeError: 'SystemExit' object has no attribute 'message'\r\n\n", "before_files": [{"content": "#  ___________________________________________________________________________\n#\n#  Pyomo: Python Optimization Modeling Objects\n#  Copyright 2017 National Technology and Engineering Solutions of Sandia, LLC\n#  Under the terms of Contract DE-NA0003525 with National Technology and\n#  Engineering Solutions of Sandia, LLC, the U.S. Government retains certain\n#  rights in this software.\n#  This software is distributed under the 3-clause BSD License.\n#  ___________________________________________________________________________\n\n\"\"\"\nScript to generate the installer for pyomo.\n\"\"\"\n\nimport sys\nimport os\n\n\ndef _find_packages(path):\n    \"\"\"\n    Generate a list of nested packages\n    \"\"\"\n    pkg_list = []\n    if not os.path.exists(path):\n        return []\n    if not os.path.exists(path+os.sep+\"__init__.py\"):\n        return []\n    else:\n        pkg_list.append(path)\n    for root, dirs, files in os.walk(path, topdown=True):\n        if root in pkg_list and \"__init__.py\" in files:\n            for name in dirs:\n                if os.path.exists(root+os.sep+name+os.sep+\"__init__.py\"):\n                    pkg_list.append(root+os.sep+name)\n    return [pkg for pkg in map(lambda x:x.replace(os.sep, \".\"), pkg_list)]\n\n\ndef read(*rnames):\n    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()\n\nrequires = [\n    'PyUtilib>=5.6.6.dev0',\n    'appdirs',\n    'ply',\n    'six>=1.4',\n    ]\nif sys.version_info < (2, 7):\n    requires.append('argparse')\n    requires.append('unittest2')\n    requires.append('ordereddict')\n\nfrom setuptools import setup\nimport sys\n\nCYTHON_REQUIRED = \"required\"\nif 'develop' in sys.argv:\n    using_cython = False\nelse:\n    using_cython = \"automatic\"\nif '--with-cython' in sys.argv:\n    using_cython = CYTHON_REQUIRED\n    sys.argv.remove('--with-cython')\nif '--without-cython' in sys.argv:\n    using_cython = False\n    sys.argv.remove('--without-cython')\n\next_modules = []\nif using_cython:\n    try:\n        import platform\n        if platform.python_implementation() != \"CPython\":\n            # break out of this try-except (disable Cython)\n            raise RuntimeError(\"Cython is only supported under CPython\")\n        from Cython.Build import cythonize\n        #\n        # Note: The Cython developers recommend that you destribute C source\n        # files to users.  But this is fine for evaluating the utility of Cython\n        #\n        import shutil\n        files = [\n            \"pyomo/core/expr/expr_pyomo5.pyx\",\n            \"pyomo/core/expr/numvalue.pyx\",\n            \"pyomo/core/util.pyx\",\n            \"pyomo/repn/standard_repn.pyx\",\n            \"pyomo/repn/plugins/cpxlp.pyx\",\n            \"pyomo/repn/plugins/gams_writer.pyx\",\n            \"pyomo/repn/plugins/baron_writer.pyx\",\n            \"pyomo/repn/plugins/ampl/ampl_.pyx\",\n        ]\n        for f in files:\n            shutil.copyfile(f[:-1], f)\n        ext_modules = cythonize(files)\n    except:\n        if using_cython == CYTHON_REQUIRED:\n            print(\"\"\"\nERROR: Cython was explicitly requested with --with-cython, but cythonization\n       of core Pyomo modules failed.\n\"\"\")\n            raise\n        using_cython = False\n\npackages = _find_packages('pyomo')\n\ndef run_setup():\n   setup(name='Pyomo',\n      #\n      # Note: trunk should have *next* major.minor\n      #     VOTD and Final releases will have major.minor.revnum\n      #\n      # When cutting a release, ALSO update _major/_minor/_revnum in\n      #\n      #     pyomo/pyomo/version/__init__.py\n      #     pyomo/RELEASE.txt\n      #\n      version='5.6.2.dev0',\n      maintainer='William E. Hart',\n      maintainer_email='wehart@sandia.gov',\n      url='http://pyomo.org',\n      license='BSD',\n      platforms=[\"any\"],\n      description='Pyomo: Python Optimization Modeling Objects',\n      long_description=read('README.txt'),\n      classifiers=[\n        'Development Status :: 5 - Production/Stable',\n        'Intended Audience :: End Users/Desktop',\n        'Intended Audience :: Science/Research',\n        'License :: OSI Approved :: BSD License',\n        'Natural Language :: English',\n        'Operating System :: MacOS',\n        'Operating System :: Microsoft :: Windows',\n        'Operating System :: Unix',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.4',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Programming Language :: Python :: Implementation :: CPython',\n        'Programming Language :: Python :: Implementation :: Jython',\n        'Programming Language :: Python :: Implementation :: PyPy',\n        'Topic :: Scientific/Engineering :: Mathematics',\n        'Topic :: Software Development :: Libraries :: Python Modules' ],\n      packages=packages,\n      keywords=['optimization'],\n      install_requires=requires,\n      ext_modules = ext_modules,\n      python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',\n      entry_points=\"\"\"\n        [console_scripts]\n        runbenders=pyomo.pysp.benders:Benders_main\n        evaluate_xhat=pyomo.pysp.evaluate_xhat:EvaluateXhat_main\n        runph=pyomo.pysp.phinit:PH_main\n        runef=pyomo.pysp.ef_writer_script:main\n        phsolverserver=pyomo.pysp.phsolverserver:main\n        scenariotreeserver=pyomo.pysp.scenariotree.server_pyro:main\n        computeconf=pyomo.pysp.computeconf:main\n\n        results_schema=pyomo.scripting.commands:results_schema\n        pyro_mip_server = pyomo.scripting.pyro_mip_server:main\n        test.pyomo = pyomo.scripting.runtests:runPyomoTests\n        pyomo = pyomo.scripting.pyomo_main:main\n        pyomo_ns = pyomo.scripting.commands:pyomo_ns\n        pyomo_nsc = pyomo.scripting.commands:pyomo_nsc\n        kill_pyro_mip_servers = pyomo.scripting.commands:kill_pyro_mip_servers\n        launch_pyro_mip_servers = pyomo.scripting.commands:launch_pyro_mip_servers\n        readsol = pyomo.scripting.commands:readsol\n        OSSolverService = pyomo.scripting.commands:OSSolverService\n        pyomo_python = pyomo.scripting.commands:pyomo_python\n        pyomo_old=pyomo.scripting.pyomo_command:main\n        get_pyomo_extras = scripts.get_pyomo_extras:main\n\n        [pyomo.command]\n        pyomo.runbenders=pyomo.pysp.benders\n        pyomo.evaluate_xhat=pyomo.pysp.evaluate_xhat\n        pyomo.runph=pyomo.pysp.phinit\n        pyomo.runef=pyomo.pysp.ef_writer_script\n        pyomo.phsolverserver=pyomo.pysp.phsolverserver\n        pyomo.scenariotreeserver=pyomo.pysp.scenariotree.server_pyro\n        pyomo.computeconf=pyomo.pysp.computeconf\n\n        pyomo.help = pyomo.scripting.driver_help\n        pyomo.test.pyomo = pyomo.scripting.runtests\n        pyomo.pyro_mip_server = pyomo.scripting.pyro_mip_server\n        pyomo.results_schema=pyomo.scripting.commands\n      \"\"\"\n      )\n\ntry:\n    run_setup()\nexcept SystemExit as e_info:\n    # Cython can generate a SystemExit exception on Windows if the\n    # environment is missing / has an incorrect Microsoft compiler.\n    # Since Cython is not strictly required, we will disable Cython and\n    # try re-running setup(), but only for this very specific situation.\n    if 'Microsoft Visual C++' not in e_info.message:\n        raise\n    elif using_cython == CYTHON_REQUIRED:\n        print(\"\"\"\nERROR: Cython was explicitly requested with --with-cython, but cythonization\n       of core Pyomo modules failed.\n\"\"\")\n        raise\n    else:\n        print(\"\"\"\nERROR: setup() failed:\n    %s\nRe-running setup() without the Cython modules\n\"\"\" % (e_info.message,))\n        ext_modules = []\n        run_setup()\n        print(\"\"\"\nWARNING: Installation completed successfully, but the attempt to cythonize\n         core Pyomo modules failed.  Cython provides performance\n         optimizations and is not required for any Pyomo functionality.\n         Cython returned the following error:\n   \"%s\"\n\"\"\" % (e_info.message,))\n", "path": "setup.py"}], "after_files": [{"content": "#  ___________________________________________________________________________\n#\n#  Pyomo: Python Optimization Modeling Objects\n#  Copyright 2017 National Technology and Engineering Solutions of Sandia, LLC\n#  Under the terms of Contract DE-NA0003525 with National Technology and\n#  Engineering Solutions of Sandia, LLC, the U.S. Government retains certain\n#  rights in this software.\n#  This software is distributed under the 3-clause BSD License.\n#  ___________________________________________________________________________\n\n\"\"\"\nScript to generate the installer for pyomo.\n\"\"\"\n\nimport sys\nimport os\n\n\ndef _find_packages(path):\n    \"\"\"\n    Generate a list of nested packages\n    \"\"\"\n    pkg_list = []\n    if not os.path.exists(path):\n        return []\n    if not os.path.exists(path+os.sep+\"__init__.py\"):\n        return []\n    else:\n        pkg_list.append(path)\n    for root, dirs, files in os.walk(path, topdown=True):\n        if root in pkg_list and \"__init__.py\" in files:\n            for name in dirs:\n                if os.path.exists(root+os.sep+name+os.sep+\"__init__.py\"):\n                    pkg_list.append(root+os.sep+name)\n    return [pkg for pkg in map(lambda x:x.replace(os.sep, \".\"), pkg_list)]\n\n\ndef read(*rnames):\n    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()\n\nrequires = [\n    'PyUtilib>=5.6.6.dev0',\n    'appdirs',\n    'ply',\n    'six>=1.4',\n    ]\nif sys.version_info < (2, 7):\n    requires.append('argparse')\n    requires.append('unittest2')\n    requires.append('ordereddict')\n\nfrom setuptools import setup\nimport sys\n\nCYTHON_REQUIRED = \"required\"\nif 'develop' in sys.argv:\n    using_cython = False\nelse:\n    using_cython = \"automatic\"\nif '--with-cython' in sys.argv:\n    using_cython = CYTHON_REQUIRED\n    sys.argv.remove('--with-cython')\nif '--without-cython' in sys.argv:\n    using_cython = False\n    sys.argv.remove('--without-cython')\n\next_modules = []\nif using_cython:\n    try:\n        import platform\n        if platform.python_implementation() != \"CPython\":\n            # break out of this try-except (disable Cython)\n            raise RuntimeError(\"Cython is only supported under CPython\")\n        from Cython.Build import cythonize\n        #\n        # Note: The Cython developers recommend that you destribute C source\n        # files to users.  But this is fine for evaluating the utility of Cython\n        #\n        import shutil\n        files = [\n            \"pyomo/core/expr/expr_pyomo5.pyx\",\n            \"pyomo/core/expr/numvalue.pyx\",\n            \"pyomo/core/util.pyx\",\n            \"pyomo/repn/standard_repn.pyx\",\n            \"pyomo/repn/plugins/cpxlp.pyx\",\n            \"pyomo/repn/plugins/gams_writer.pyx\",\n            \"pyomo/repn/plugins/baron_writer.pyx\",\n            \"pyomo/repn/plugins/ampl/ampl_.pyx\",\n        ]\n        for f in files:\n            shutil.copyfile(f[:-1], f)\n        ext_modules = cythonize(files)\n    except:\n        if using_cython == CYTHON_REQUIRED:\n            print(\"\"\"\nERROR: Cython was explicitly requested with --with-cython, but cythonization\n       of core Pyomo modules failed.\n\"\"\")\n            raise\n        using_cython = False\n\npackages = _find_packages('pyomo')\n\ndef run_setup():\n   setup(name='Pyomo',\n      #\n      # Note: trunk should have *next* major.minor\n      #     VOTD and Final releases will have major.minor.revnum\n      #\n      # When cutting a release, ALSO update _major/_minor/_revnum in\n      #\n      #     pyomo/pyomo/version/__init__.py\n      #     pyomo/RELEASE.txt\n      #\n      version='5.6.2.dev0',\n      maintainer='William E. Hart',\n      maintainer_email='wehart@sandia.gov',\n      url='http://pyomo.org',\n      license='BSD',\n      platforms=[\"any\"],\n      description='Pyomo: Python Optimization Modeling Objects',\n      long_description=read('README.txt'),\n      classifiers=[\n        'Development Status :: 5 - Production/Stable',\n        'Intended Audience :: End Users/Desktop',\n        'Intended Audience :: Science/Research',\n        'License :: OSI Approved :: BSD License',\n        'Natural Language :: English',\n        'Operating System :: MacOS',\n        'Operating System :: Microsoft :: Windows',\n        'Operating System :: Unix',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.4',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Programming Language :: Python :: Implementation :: CPython',\n        'Programming Language :: Python :: Implementation :: Jython',\n        'Programming Language :: Python :: Implementation :: PyPy',\n        'Topic :: Scientific/Engineering :: Mathematics',\n        'Topic :: Software Development :: Libraries :: Python Modules' ],\n      packages=packages,\n      keywords=['optimization'],\n      install_requires=requires,\n      ext_modules = ext_modules,\n      python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',\n      entry_points=\"\"\"\n        [console_scripts]\n        runbenders=pyomo.pysp.benders:Benders_main\n        evaluate_xhat=pyomo.pysp.evaluate_xhat:EvaluateXhat_main\n        runph=pyomo.pysp.phinit:PH_main\n        runef=pyomo.pysp.ef_writer_script:main\n        phsolverserver=pyomo.pysp.phsolverserver:main\n        scenariotreeserver=pyomo.pysp.scenariotree.server_pyro:main\n        computeconf=pyomo.pysp.computeconf:main\n\n        results_schema=pyomo.scripting.commands:results_schema\n        pyro_mip_server = pyomo.scripting.pyro_mip_server:main\n        test.pyomo = pyomo.scripting.runtests:runPyomoTests\n        pyomo = pyomo.scripting.pyomo_main:main\n        pyomo_ns = pyomo.scripting.commands:pyomo_ns\n        pyomo_nsc = pyomo.scripting.commands:pyomo_nsc\n        kill_pyro_mip_servers = pyomo.scripting.commands:kill_pyro_mip_servers\n        launch_pyro_mip_servers = pyomo.scripting.commands:launch_pyro_mip_servers\n        readsol = pyomo.scripting.commands:readsol\n        OSSolverService = pyomo.scripting.commands:OSSolverService\n        pyomo_python = pyomo.scripting.commands:pyomo_python\n        pyomo_old=pyomo.scripting.pyomo_command:main\n        get_pyomo_extras = scripts.get_pyomo_extras:main\n\n        [pyomo.command]\n        pyomo.runbenders=pyomo.pysp.benders\n        pyomo.evaluate_xhat=pyomo.pysp.evaluate_xhat\n        pyomo.runph=pyomo.pysp.phinit\n        pyomo.runef=pyomo.pysp.ef_writer_script\n        pyomo.phsolverserver=pyomo.pysp.phsolverserver\n        pyomo.scenariotreeserver=pyomo.pysp.scenariotree.server_pyro\n        pyomo.computeconf=pyomo.pysp.computeconf\n\n        pyomo.help = pyomo.scripting.driver_help\n        pyomo.test.pyomo = pyomo.scripting.runtests\n        pyomo.pyro_mip_server = pyomo.scripting.pyro_mip_server\n        pyomo.results_schema=pyomo.scripting.commands\n      \"\"\"\n      )\n\ntry:\n    run_setup()\nexcept SystemExit as e_info:\n    # Cython can generate a SystemExit exception on Windows if the\n    # environment is missing / has an incorrect Microsoft compiler.\n    # Since Cython is not strictly required, we will disable Cython and\n    # try re-running setup(), but only for this very specific situation.\n    if 'Microsoft Visual C++' not in str(e_info):\n        raise\n    elif using_cython == CYTHON_REQUIRED:\n        print(\"\"\"\nERROR: Cython was explicitly requested with --with-cython, but cythonization\n       of core Pyomo modules failed.\n\"\"\")\n        raise\n    else:\n        print(\"\"\"\nERROR: setup() failed:\n    %s\nRe-running setup() without the Cython modules\n\"\"\" % (e_info.message,))\n        ext_modules = []\n        run_setup()\n        print(\"\"\"\nWARNING: Installation completed successfully, but the attempt to cythonize\n         core Pyomo modules failed.  Cython provides performance\n         optimizations and is not required for any Pyomo functionality.\n         Cython returned the following error:\n   \"%s\"\n\"\"\" % (e_info.message,))\n", "path": "setup.py"}]}