We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
`build-extensions` fails on pip install because it can't find `FindASL.cmake`
## Summary
In a fresh Python 3.9.9 environment, I ran `pip install pyomo`, then `pyomo build-extensions`, and get a failure to build the PyNumero libraries as `ampl_function_demo/src/FindASL.cmake` is not found. It doesn't appear to be anywhere in `site_packages`.

### Steps to reproduce the issue

```console
$ pip install pyomo
$ pyomo build-extensions
```

### Error Message

```
**** Building PyNumero libraries ****
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:18 (INCLUDE):
  INCLUDE could not find load file:

    /home/robert/idaes/fresh-env/lib/python3.9/site-packages/pyomo/contrib/pynumero/src/../../ampl_function_demo/src/FindASL.cmake


-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Configuring incomplete, errors occurred!
See also "/tmp/tmpmu0rmdiu/CMakeFiles/CMakeOutput.log".
ERROR: DistutilsExecError: command '/usr/bin/cmake' failed with exit code 1
```

### Information on your system

Pyomo version: 6.3.0
Python version: 3.9.9
Operating system: Ubuntu 18.04
How Pyomo was installed (PyPI, conda, source): pip


--- 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 os
16 import platform
17 import sys
18 from setuptools import setup, find_packages, Command
19 try:
20     from setuptools import DistutilsOptionError
21 except ImportError:
22     from distutils.errors import DistutilsOptionError
23 
24 def read(*rnames):
25     with open(os.path.join(os.path.dirname(__file__), *rnames)) as README:
26         # Strip all leading badges up to, but not including the COIN-OR
27         # badge so that they do not appear in the PyPI description
28         while True:
29             line = README.readline()
30             if 'COIN-OR' in line:
31                 break
32             if line.strip() and '[![' not in line:
33                 break
34         return line + README.read()
35 
36 def import_pyomo_module(*path):
37     _module_globals = dict(globals())
38     _module_globals['__name__'] = None
39     _source = os.path.join(os.path.dirname(__file__), *path)
40     with open(_source) as _FILE:
41         exec(_FILE.read(), _module_globals)
42     return _module_globals
43 
44 def get_version():
45     # Source pyomo/version/info.py to get the version number
46     return import_pyomo_module('pyomo','version','info.py')['__version__']
47 
48 CYTHON_REQUIRED = "required"
49 if not any(arg.startswith(cmd)
50            for cmd in ('build','install','bdist') for arg  in sys.argv):
51     using_cython = False
52 else:
53     using_cython = "automatic"
54 if '--with-cython' in sys.argv:
55     using_cython = CYTHON_REQUIRED
56     sys.argv.remove('--with-cython')
57 if '--without-cython' in sys.argv:
58     using_cython = False
59     sys.argv.remove('--without-cython')
60 
61 ext_modules = []
62 if using_cython:
63     try:
64         if platform.python_implementation() != "CPython":
65             # break out of this try-except (disable Cython)
66             raise RuntimeError("Cython is only supported under CPython")
67         from Cython.Build import cythonize
68         #
69         # Note: The Cython developers recommend that you destribute C source
70         # files to users.  But this is fine for evaluating the utility of Cython
71         #
72         import shutil
73         files = [
74             "pyomo/core/expr/numvalue.pyx",
75             "pyomo/core/expr/numeric_expr.pyx",
76             "pyomo/core/expr/logical_expr.pyx",
77             #"pyomo/core/expr/visitor.pyx",
78             "pyomo/core/util.pyx",
79             "pyomo/repn/standard_repn.pyx",
80             "pyomo/repn/plugins/cpxlp.pyx",
81             "pyomo/repn/plugins/gams_writer.pyx",
82             "pyomo/repn/plugins/baron_writer.pyx",
83             "pyomo/repn/plugins/ampl/ampl_.pyx",
84         ]
85         for f in files:
86             shutil.copyfile(f[:-1], f)
87         ext_modules = cythonize(files,
88                                 compiler_directives={"language_level": 3})
89     except:
90         if using_cython == CYTHON_REQUIRED:
91             print("""
92 ERROR: Cython was explicitly requested with --with-cython, but cythonization
93        of core Pyomo modules failed.
94 """)
95             raise
96         using_cython = False
97 
98 if (('--with-distributable-extensions' in sys.argv)
99     or (os.getenv('PYOMO_SETUP_ARGS') is not None and
100         '--with-distributable-extensions' in os.getenv('PYOMO_SETUP_ARGS'))):
101     try:
102         sys.argv.remove('--with-distributable-extensions')
103     except:
104         pass
105     #
106     # Import the APPSI extension builder
107     #
108     appsi_extension = import_pyomo_module(
109         'pyomo', 'contrib', 'appsi', 'build.py')['get_appsi_extension'](
110             in_setup=True, appsi_root=os.path.join(
111                 os.path.dirname(__file__), 'pyomo', 'contrib', 'appsi'))
112     ext_modules.append(appsi_extension)
113 
114 
115 class DependenciesCommand(Command):
116     """Custom setuptools command
117 
118     This will output the list of dependencies, including any optional
119     dependencies for 'extras_require` targets.  This is needed so that
120     we can (relatively) easily extract what `pip install '.[optional]'`
121     would have done so that we can pass it on to a 'conda install'
122     command when setting up Pyomo testing in a conda environment
123     (because conda for all intents does not acknowledge
124     `extras_require`).
125 
126     """
127     description = "list the dependencies for this package"
128     user_options = [
129         ('extras=', None, 'extra targets to include'),
130     ]
131 
132     def initialize_options(self):
133         self.extras = None
134 
135     def finalize_options(self):
136         if self.extras is not None:
137             self.extras = [
138                 e for e in (_.strip() for _ in self.extras.split(',')) if e
139             ]
140             for e in self.extras:
141                 if e not in setup_kwargs['extras_require']:
142                     raise DistutilsOptionError(
143                         "extras can only include {%s}"
144                         % (', '.join(setup_kwargs['extras_require'])))
145 
146     def run(self):
147         deps = list(self._print_deps(setup_kwargs['install_requires']))
148         if self.extras is not None:
149             for e in self.extras:
150                 deps.extend(self._print_deps(setup_kwargs['extras_require'][e]))
151         print(' '.join(deps))
152 
153     def _print_deps(self, deplist):
154         implementation_name = sys.implementation.name
155         platform_system = platform.system()
156         python_version = '.'.join(platform.python_version_tuple()[:2])
157         for entry in deplist:
158             dep, _, condition = (_.strip() for _ in entry.partition(';'))
159             if condition and not eval(condition):
160                 continue
161             yield dep
162 
163 
164 setup_kwargs = dict(
165     name = 'Pyomo',
166     #
167     # Note: the release number is set in pyomo/version/info.py
168     #
169     cmdclass = {'dependencies': DependenciesCommand},
170     version = get_version(),
171     maintainer = 'Pyomo Developer Team',
172     maintainer_email = 'pyomo-developers@googlegroups.com',
173     url = 'http://pyomo.org',
174     license = 'BSD',
175     platforms = ["any"],
176     description = 'Pyomo: Python Optimization Modeling Objects',
177     long_description = read('README.md'),
178     long_description_content_type = 'text/markdown',
179     keywords = ['optimization'],
180     classifiers = [
181         'Development Status :: 5 - Production/Stable',
182         'Intended Audience :: End Users/Desktop',
183         'Intended Audience :: Science/Research',
184         'License :: OSI Approved :: BSD License',
185         'Natural Language :: English',
186         'Operating System :: MacOS',
187         'Operating System :: Microsoft :: Windows',
188         'Operating System :: Unix',
189         'Programming Language :: Python',
190         'Programming Language :: Python :: 3',
191         'Programming Language :: Python :: 3.7',
192         'Programming Language :: Python :: 3.8',
193         'Programming Language :: Python :: 3.9',
194         'Programming Language :: Python :: 3.10',
195         'Programming Language :: Python :: Implementation :: CPython',
196         'Programming Language :: Python :: Implementation :: PyPy',
197         'Topic :: Scientific/Engineering :: Mathematics',
198         'Topic :: Software Development :: Libraries :: Python Modules' ],
199     python_requires = '>=3.7',
200     install_requires = [
201         'ply',
202     ],
203     extras_require = {
204         'tests': [
205             'coverage',
206             'pytest',
207             'pytest-parallel',
208             'parameterized',
209             'pybind11',
210         ],
211         'docs': [
212             'Sphinx>2',
213             'sphinx-copybutton',
214             'sphinx_rtd_theme>0.5',
215             'sphinxcontrib-jsmath',
216             'sphinxcontrib-napoleon',
217             'numpy', # Needed by autodoc for pynumero
218         ],
219         'optional': [
220             'dill',      # No direct use, but improves lambda pickle
221             'ipython',   # contrib.viewer
222             'matplotlib',
223             'networkx',  # network, incidence_analysis, community_detection
224             'numpy',
225             'openpyxl',  # dataportals
226             #'pathos',   # requested for #963, but PR currently closed
227             'pint',      # units
228             'python-louvain', # community_detection
229             'pyyaml',    # core
230             'sympy',     # differentiation
231             'xlrd',      # dataportals
232             'z3-solver', # community_detection
233             #
234             # subprocess output is merged more reliably if
235             # 'PeekNamedPipe' is available from pywin32
236             'pywin32; platform_system=="Windows"',
237             #
238             # The following optional dependencies are difficult to
239             # install on PyPy (binary wheels are not available), so we
240             # will only "require" them on other (CPython) platforms:
241             'casadi; implementation_name!="pypy"',  # dae
242             'numdifftools; implementation_name!="pypy"', # pynumero
243             'pandas; implementation_name!="pypy"',
244             'scipy; implementation_name!="pypy"',
245             'seaborn; implementation_name!="pypy"',   # parmest.graphics
246         ],
247     },
248     packages = find_packages(exclude=("scripts",)),
249     package_data = {
250         "pyomo.contrib.appsi.cmodel": ["src/*"],
251         "pyomo.contrib.mcpp": ["*.cpp"],
252         "pyomo.contrib.pynumero": ['src/*', 'src/tests/*'],
253         "pyomo.contrib.viewer": ["*.ui"],
254     },
255     ext_modules = ext_modules,
256     entry_points = """
257     [console_scripts]
258     pyomo = pyomo.scripting.pyomo_main:main_console_script
259 
260     [pyomo.command]
261     pyomo.help = pyomo.scripting.driver_help
262     pyomo.viewer=pyomo.contrib.viewer.pyomo_viewer
263     """
264 )
265 
266 
267 try:
268     setup(**setup_kwargs)
269 except SystemExit as e_info:
270     # Cython can generate a SystemExit exception on Windows if the
271     # environment is missing / has an incorrect Microsoft compiler.
272     # Since Cython is not strictly required, we will disable Cython and
273     # try re-running setup(), but only for this very specific situation.
274     if 'Microsoft Visual C++' not in str(e_info):
275         raise
276     elif using_cython == CYTHON_REQUIRED:
277         print("""
278 ERROR: Cython was explicitly requested with --with-cython, but cythonization
279        of core Pyomo modules failed.
280 """)
281         raise
282     else:
283         print("""
284 ERROR: setup() failed:
285     %s
286 Re-running setup() without the Cython modules
287 """ % (str(e_info),))
288         setup_kwargs['ext_modules'] = []
289         setup(**setup_kwargs)
290         print("""
291 WARNING: Installation completed successfully, but the attempt to cythonize
292          core Pyomo modules failed.  Cython provides performance
293          optimizations and is not required for any Pyomo functionality.
294          Cython returned the following error:
295    "%s"
296 """ % (str(e_info),))
297
```
--- 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
@@ -247,6 +247,7 @@
     },
     packages = find_packages(exclude=("scripts",)),
     package_data = {
+        "pyomo.contrib.ampl_function_demo": ["src/*"],
         "pyomo.contrib.appsi.cmodel": ["src/*"],
         "pyomo.contrib.mcpp": ["*.cpp"],
         "pyomo.contrib.pynumero": ['src/*', 'src/tests/*'],

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -247,6 +247,7 @@\n     },\n     packages = find_packages(exclude=(\"scripts\",)),\n     package_data = {\n+        \"pyomo.contrib.ampl_function_demo\": [\"src/*\"],\n         \"pyomo.contrib.appsi.cmodel\": [\"src/*\"],\n         \"pyomo.contrib.mcpp\": [\"*.cpp\"],\n         \"pyomo.contrib.pynumero\": ['src/*', 'src/tests/*'],\n", "issue": "`build-extensions` fails on pip install because it can't find `FindASL.cmake`\n## Summary\r\nIn a fresh Python 3.9.9 environment, I ran `pip install pyomo`, then `pyomo build-extensions`, and get a failure to build the PyNumero libraries as `ampl_function_demo/src/FindASL.cmake` is not found. It doesn't appear to be anywhere in `site_packages`.\r\n\r\n### Steps to reproduce the issue\r\n\r\n```console\r\n$ pip install pyomo\r\n$ pyomo build-extensions\r\n```\r\n\r\n### Error Message\r\n\r\n```\r\n**** Building PyNumero libraries ****\r\n-- The C compiler identification is GNU 7.5.0\r\n-- The CXX compiler identification is GNU 7.5.0\r\n-- Check for working C compiler: /usr/bin/cc\r\n-- Check for working C compiler: /usr/bin/cc -- works\r\n-- Detecting C compiler ABI info\r\n-- Detecting C compiler ABI info - done\r\n-- Detecting C compile features\r\n-- Detecting C compile features - done\r\n-- Check for working CXX compiler: /usr/bin/c++\r\n-- Check for working CXX compiler: /usr/bin/c++ -- works\r\n-- Detecting CXX compiler ABI info\r\n-- Detecting CXX compiler ABI info - done\r\n-- Detecting CXX compile features\r\n-- Detecting CXX compile features - done\r\nCMake Error at CMakeLists.txt:18 (INCLUDE):\r\n  INCLUDE could not find load file:\r\n\r\n    /home/robert/idaes/fresh-env/lib/python3.9/site-packages/pyomo/contrib/pynumero/src/../../ampl_function_demo/src/FindASL.cmake\r\n\r\n\r\n-- Found PkgConfig: /usr/bin/pkg-config (found version \"0.29.1\") \r\n-- Configuring incomplete, errors occurred!\r\nSee also \"/tmp/tmpmu0rmdiu/CMakeFiles/CMakeOutput.log\".\r\nERROR: DistutilsExecError: command '/usr/bin/cmake' failed with exit code 1\r\n```\r\n\r\n### Information on your system\r\n\r\nPyomo version: 6.3.0\r\nPython version: 3.9.9\r\nOperating system: Ubuntu 18.04\r\nHow Pyomo was installed (PyPI, conda, source): pip\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 os\nimport platform\nimport sys\nfrom setuptools import setup, find_packages, Command\ntry:\n    from setuptools import DistutilsOptionError\nexcept ImportError:\n    from distutils.errors import DistutilsOptionError\n\ndef read(*rnames):\n    with open(os.path.join(os.path.dirname(__file__), *rnames)) as README:\n        # Strip all leading badges up to, but not including the COIN-OR\n        # badge so that they do not appear in the PyPI description\n        while True:\n            line = README.readline()\n            if 'COIN-OR' in line:\n                break\n            if line.strip() and '[![' not in line:\n                break\n        return line + README.read()\n\ndef import_pyomo_module(*path):\n    _module_globals = dict(globals())\n    _module_globals['__name__'] = None\n    _source = os.path.join(os.path.dirname(__file__), *path)\n    with open(_source) as _FILE:\n        exec(_FILE.read(), _module_globals)\n    return _module_globals\n\ndef get_version():\n    # Source pyomo/version/info.py to get the version number\n    return import_pyomo_module('pyomo','version','info.py')['__version__']\n\nCYTHON_REQUIRED = \"required\"\nif not any(arg.startswith(cmd)\n           for cmd in ('build','install','bdist') for arg  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        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/numvalue.pyx\",\n            \"pyomo/core/expr/numeric_expr.pyx\",\n            \"pyomo/core/expr/logical_expr.pyx\",\n            #\"pyomo/core/expr/visitor.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                                compiler_directives={\"language_level\": 3})\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\nif (('--with-distributable-extensions' in sys.argv)\n    or (os.getenv('PYOMO_SETUP_ARGS') is not None and\n        '--with-distributable-extensions' in os.getenv('PYOMO_SETUP_ARGS'))):\n    try:\n        sys.argv.remove('--with-distributable-extensions')\n    except:\n        pass\n    #\n    # Import the APPSI extension builder\n    #\n    appsi_extension = import_pyomo_module(\n        'pyomo', 'contrib', 'appsi', 'build.py')['get_appsi_extension'](\n            in_setup=True, appsi_root=os.path.join(\n                os.path.dirname(__file__), 'pyomo', 'contrib', 'appsi'))\n    ext_modules.append(appsi_extension)\n\n\nclass DependenciesCommand(Command):\n    \"\"\"Custom setuptools command\n\n    This will output the list of dependencies, including any optional\n    dependencies for 'extras_require` targets.  This is needed so that\n    we can (relatively) easily extract what `pip install '.[optional]'`\n    would have done so that we can pass it on to a 'conda install'\n    command when setting up Pyomo testing in a conda environment\n    (because conda for all intents does not acknowledge\n    `extras_require`).\n\n    \"\"\"\n    description = \"list the dependencies for this package\"\n    user_options = [\n        ('extras=', None, 'extra targets to include'),\n    ]\n\n    def initialize_options(self):\n        self.extras = None\n\n    def finalize_options(self):\n        if self.extras is not None:\n            self.extras = [\n                e for e in (_.strip() for _ in self.extras.split(',')) if e\n            ]\n            for e in self.extras:\n                if e not in setup_kwargs['extras_require']:\n                    raise DistutilsOptionError(\n                        \"extras can only include {%s}\"\n                        % (', '.join(setup_kwargs['extras_require'])))\n\n    def run(self):\n        deps = list(self._print_deps(setup_kwargs['install_requires']))\n        if self.extras is not None:\n            for e in self.extras:\n                deps.extend(self._print_deps(setup_kwargs['extras_require'][e]))\n        print(' '.join(deps))\n\n    def _print_deps(self, deplist):\n        implementation_name = sys.implementation.name\n        platform_system = platform.system()\n        python_version = '.'.join(platform.python_version_tuple()[:2])\n        for entry in deplist:\n            dep, _, condition = (_.strip() for _ in entry.partition(';'))\n            if condition and not eval(condition):\n                continue\n            yield dep\n\n\nsetup_kwargs = dict(\n    name = 'Pyomo',\n    #\n    # Note: the release number is set in pyomo/version/info.py\n    #\n    cmdclass = {'dependencies': DependenciesCommand},\n    version = get_version(),\n    maintainer = 'Pyomo Developer Team',\n    maintainer_email = 'pyomo-developers@googlegroups.com',\n    url = 'http://pyomo.org',\n    license = 'BSD',\n    platforms = [\"any\"],\n    description = 'Pyomo: Python Optimization Modeling Objects',\n    long_description = read('README.md'),\n    long_description_content_type = 'text/markdown',\n    keywords = ['optimization'],\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 :: 3',\n        'Programming Language :: Python :: 3.7',\n        'Programming Language :: Python :: 3.8',\n        'Programming Language :: Python :: 3.9',\n        'Programming Language :: Python :: 3.10',\n        'Programming Language :: Python :: Implementation :: CPython',\n        'Programming Language :: Python :: Implementation :: PyPy',\n        'Topic :: Scientific/Engineering :: Mathematics',\n        'Topic :: Software Development :: Libraries :: Python Modules' ],\n    python_requires = '>=3.7',\n    install_requires = [\n        'ply',\n    ],\n    extras_require = {\n        'tests': [\n            'coverage',\n            'pytest',\n            'pytest-parallel',\n            'parameterized',\n            'pybind11',\n        ],\n        'docs': [\n            'Sphinx>2',\n            'sphinx-copybutton',\n            'sphinx_rtd_theme>0.5',\n            'sphinxcontrib-jsmath',\n            'sphinxcontrib-napoleon',\n            'numpy', # Needed by autodoc for pynumero\n        ],\n        'optional': [\n            'dill',      # No direct use, but improves lambda pickle\n            'ipython',   # contrib.viewer\n            'matplotlib',\n            'networkx',  # network, incidence_analysis, community_detection\n            'numpy',\n            'openpyxl',  # dataportals\n            #'pathos',   # requested for #963, but PR currently closed\n            'pint',      # units\n            'python-louvain', # community_detection\n            'pyyaml',    # core\n            'sympy',     # differentiation\n            'xlrd',      # dataportals\n            'z3-solver', # community_detection\n            #\n            # subprocess output is merged more reliably if\n            # 'PeekNamedPipe' is available from pywin32\n            'pywin32; platform_system==\"Windows\"',\n            #\n            # The following optional dependencies are difficult to\n            # install on PyPy (binary wheels are not available), so we\n            # will only \"require\" them on other (CPython) platforms:\n            'casadi; implementation_name!=\"pypy\"',  # dae\n            'numdifftools; implementation_name!=\"pypy\"', # pynumero\n            'pandas; implementation_name!=\"pypy\"',\n            'scipy; implementation_name!=\"pypy\"',\n            'seaborn; implementation_name!=\"pypy\"',   # parmest.graphics\n        ],\n    },\n    packages = find_packages(exclude=(\"scripts\",)),\n    package_data = {\n        \"pyomo.contrib.appsi.cmodel\": [\"src/*\"],\n        \"pyomo.contrib.mcpp\": [\"*.cpp\"],\n        \"pyomo.contrib.pynumero\": ['src/*', 'src/tests/*'],\n        \"pyomo.contrib.viewer\": [\"*.ui\"],\n    },\n    ext_modules = ext_modules,\n    entry_points = \"\"\"\n    [console_scripts]\n    pyomo = pyomo.scripting.pyomo_main:main_console_script\n\n    [pyomo.command]\n    pyomo.help = pyomo.scripting.driver_help\n    pyomo.viewer=pyomo.contrib.viewer.pyomo_viewer\n    \"\"\"\n)\n\n\ntry:\n    setup(**setup_kwargs)\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\"\"\" % (str(e_info),))\n        setup_kwargs['ext_modules'] = []\n        setup(**setup_kwargs)\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\"\"\" % (str(e_info),))\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 os\nimport platform\nimport sys\nfrom setuptools import setup, find_packages, Command\ntry:\n    from setuptools import DistutilsOptionError\nexcept ImportError:\n    from distutils.errors import DistutilsOptionError\n\ndef read(*rnames):\n    with open(os.path.join(os.path.dirname(__file__), *rnames)) as README:\n        # Strip all leading badges up to, but not including the COIN-OR\n        # badge so that they do not appear in the PyPI description\n        while True:\n            line = README.readline()\n            if 'COIN-OR' in line:\n                break\n            if line.strip() and '[![' not in line:\n                break\n        return line + README.read()\n\ndef import_pyomo_module(*path):\n    _module_globals = dict(globals())\n    _module_globals['__name__'] = None\n    _source = os.path.join(os.path.dirname(__file__), *path)\n    with open(_source) as _FILE:\n        exec(_FILE.read(), _module_globals)\n    return _module_globals\n\ndef get_version():\n    # Source pyomo/version/info.py to get the version number\n    return import_pyomo_module('pyomo','version','info.py')['__version__']\n\nCYTHON_REQUIRED = \"required\"\nif not any(arg.startswith(cmd)\n           for cmd in ('build','install','bdist') for arg  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        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/numvalue.pyx\",\n            \"pyomo/core/expr/numeric_expr.pyx\",\n            \"pyomo/core/expr/logical_expr.pyx\",\n            #\"pyomo/core/expr/visitor.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                                compiler_directives={\"language_level\": 3})\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\nif (('--with-distributable-extensions' in sys.argv)\n    or (os.getenv('PYOMO_SETUP_ARGS') is not None and\n        '--with-distributable-extensions' in os.getenv('PYOMO_SETUP_ARGS'))):\n    try:\n        sys.argv.remove('--with-distributable-extensions')\n    except:\n        pass\n    #\n    # Import the APPSI extension builder\n    #\n    appsi_extension = import_pyomo_module(\n        'pyomo', 'contrib', 'appsi', 'build.py')['get_appsi_extension'](\n            in_setup=True, appsi_root=os.path.join(\n                os.path.dirname(__file__), 'pyomo', 'contrib', 'appsi'))\n    ext_modules.append(appsi_extension)\n\n\nclass DependenciesCommand(Command):\n    \"\"\"Custom setuptools command\n\n    This will output the list of dependencies, including any optional\n    dependencies for 'extras_require` targets.  This is needed so that\n    we can (relatively) easily extract what `pip install '.[optional]'`\n    would have done so that we can pass it on to a 'conda install'\n    command when setting up Pyomo testing in a conda environment\n    (because conda for all intents does not acknowledge\n    `extras_require`).\n\n    \"\"\"\n    description = \"list the dependencies for this package\"\n    user_options = [\n        ('extras=', None, 'extra targets to include'),\n    ]\n\n    def initialize_options(self):\n        self.extras = None\n\n    def finalize_options(self):\n        if self.extras is not None:\n            self.extras = [\n                e for e in (_.strip() for _ in self.extras.split(',')) if e\n            ]\n            for e in self.extras:\n                if e not in setup_kwargs['extras_require']:\n                    raise DistutilsOptionError(\n                        \"extras can only include {%s}\"\n                        % (', '.join(setup_kwargs['extras_require'])))\n\n    def run(self):\n        deps = list(self._print_deps(setup_kwargs['install_requires']))\n        if self.extras is not None:\n            for e in self.extras:\n                deps.extend(self._print_deps(setup_kwargs['extras_require'][e]))\n        print(' '.join(deps))\n\n    def _print_deps(self, deplist):\n        implementation_name = sys.implementation.name\n        platform_system = platform.system()\n        python_version = '.'.join(platform.python_version_tuple()[:2])\n        for entry in deplist:\n            dep, _, condition = (_.strip() for _ in entry.partition(';'))\n            if condition and not eval(condition):\n                continue\n            yield dep\n\n\nsetup_kwargs = dict(\n    name = 'Pyomo',\n    #\n    # Note: the release number is set in pyomo/version/info.py\n    #\n    cmdclass = {'dependencies': DependenciesCommand},\n    version = get_version(),\n    maintainer = 'Pyomo Developer Team',\n    maintainer_email = 'pyomo-developers@googlegroups.com',\n    url = 'http://pyomo.org',\n    license = 'BSD',\n    platforms = [\"any\"],\n    description = 'Pyomo: Python Optimization Modeling Objects',\n    long_description = read('README.md'),\n    long_description_content_type = 'text/markdown',\n    keywords = ['optimization'],\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 :: 3',\n        'Programming Language :: Python :: 3.7',\n        'Programming Language :: Python :: 3.8',\n        'Programming Language :: Python :: 3.9',\n        'Programming Language :: Python :: 3.10',\n        'Programming Language :: Python :: Implementation :: CPython',\n        'Programming Language :: Python :: Implementation :: PyPy',\n        'Topic :: Scientific/Engineering :: Mathematics',\n        'Topic :: Software Development :: Libraries :: Python Modules' ],\n    python_requires = '>=3.7',\n    install_requires = [\n        'ply',\n    ],\n    extras_require = {\n        'tests': [\n            'coverage',\n            'pytest',\n            'pytest-parallel',\n            'parameterized',\n            'pybind11',\n        ],\n        'docs': [\n            'Sphinx>2',\n            'sphinx-copybutton',\n            'sphinx_rtd_theme>0.5',\n            'sphinxcontrib-jsmath',\n            'sphinxcontrib-napoleon',\n            'numpy', # Needed by autodoc for pynumero\n        ],\n        'optional': [\n            'dill',      # No direct use, but improves lambda pickle\n            'ipython',   # contrib.viewer\n            'matplotlib',\n            'networkx',  # network, incidence_analysis, community_detection\n            'numpy',\n            'openpyxl',  # dataportals\n            #'pathos',   # requested for #963, but PR currently closed\n            'pint',      # units\n            'python-louvain', # community_detection\n            'pyyaml',    # core\n            'sympy',     # differentiation\n            'xlrd',      # dataportals\n            'z3-solver', # community_detection\n            #\n            # subprocess output is merged more reliably if\n            # 'PeekNamedPipe' is available from pywin32\n            'pywin32; platform_system==\"Windows\"',\n            #\n            # The following optional dependencies are difficult to\n            # install on PyPy (binary wheels are not available), so we\n            # will only \"require\" them on other (CPython) platforms:\n            'casadi; implementation_name!=\"pypy\"',  # dae\n            'numdifftools; implementation_name!=\"pypy\"', # pynumero\n            'pandas; implementation_name!=\"pypy\"',\n            'scipy; implementation_name!=\"pypy\"',\n            'seaborn; implementation_name!=\"pypy\"',   # parmest.graphics\n        ],\n    },\n    packages = find_packages(exclude=(\"scripts\",)),\n    package_data = {\n        \"pyomo.contrib.ampl_function_demo\": [\"src/*\"],\n        \"pyomo.contrib.appsi.cmodel\": [\"src/*\"],\n        \"pyomo.contrib.mcpp\": [\"*.cpp\"],\n        \"pyomo.contrib.pynumero\": ['src/*', 'src/tests/*'],\n        \"pyomo.contrib.viewer\": [\"*.ui\"],\n    },\n    ext_modules = ext_modules,\n    entry_points = \"\"\"\n    [console_scripts]\n    pyomo = pyomo.scripting.pyomo_main:main_console_script\n\n    [pyomo.command]\n    pyomo.help = pyomo.scripting.driver_help\n    pyomo.viewer=pyomo.contrib.viewer.pyomo_viewer\n    \"\"\"\n)\n\n\ntry:\n    setup(**setup_kwargs)\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\"\"\" % (str(e_info),))\n        setup_kwargs['ext_modules'] = []\n        setup(**setup_kwargs)\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\"\"\" % (str(e_info),))\n", "path": "setup.py"}]}