From 1c9de9c0ba244eb2069e40c2da4566e4426b2d2a Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Thu, 4 Aug 2022 07:51:09 -0500 Subject: [PATCH] [Python] Add README.txt documenting changed sample location --- interfaces/cython/SConscript | 3 ++- interfaces/cython/cantera/examples/README.txt | 5 +++++ interfaces/cython/setup.cfg.in | 8 ++++---- interfaces/python_sdist/setup.cfg.in | 2 +- test/python/test_reactor.py | 4 ++-- 5 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 interfaces/cython/cantera/examples/README.txt diff --git a/interfaces/cython/SConscript b/interfaces/cython/SConscript index 0be3d00926..beb587494e 100644 --- a/interfaces/cython/SConscript +++ b/interfaces/cython/SConscript @@ -117,7 +117,8 @@ env['python_module'] = mod env['python_extension'] = ext localenv.Depends(mod, [ext, dataFiles, setup_cfg, readme, license, - "setup.py", "pyproject.toml", "cantera/test/README.txt"]) + "setup.py", "pyproject.toml", + "cantera/test/README.txt", "cantera/examples/README.txt"]) localenv.Depends(ext, localenv['cantera_staticlib']) for f in (multi_glob(localenv, 'cantera', 'py') + diff --git a/interfaces/cython/cantera/examples/README.txt b/interfaces/cython/cantera/examples/README.txt new file mode 100644 index 0000000000..8b042d4500 --- /dev/null +++ b/interfaces/cython/cantera/examples/README.txt @@ -0,0 +1,5 @@ +Starting with Cantera 3.0, Python examples are no longer packaged with the Python +module. Examples illustrating the usage of the Python module can be found on Cantera's +website (https://cantera.org). Alternatively, examples can be accessed in the directory +"samples/python" of the source code, which can be retrieved from the project's GitHub +repository (https://github.com/Cantera/cantera). diff --git a/interfaces/cython/setup.cfg.in b/interfaces/cython/setup.cfg.in index 0369aaebaa..4cd9269fc1 100644 --- a/interfaces/cython/setup.cfg.in +++ b/interfaces/cython/setup.cfg.in @@ -50,10 +50,10 @@ packages = [options.package_data] cantera.data = *.*, */*.* -# The module extension needs to be here since we don't want setuptools to -# compile the extension, so there are no `source` files in -# the setup.py extension. -cantera = *.pxd, *@module_ext@, test/*.txt +# The module extension needs to be here since we don't want setuptools to compile +# the extension, so there are no ``source`` files in the setup.py ``extension`` and +# we have to treat the module as package data. +cantera = *.pxd, *@module_ext@, test/*.txt, examples/*.txt [options.extras_require] hdf5 = h5py diff --git a/interfaces/python_sdist/setup.cfg.in b/interfaces/python_sdist/setup.cfg.in index d8d1884151..0d480caceb 100644 --- a/interfaces/python_sdist/setup.cfg.in +++ b/interfaces/python_sdist/setup.cfg.in @@ -53,7 +53,7 @@ packages = # included in the wheel. [options.package_data] cantera.data = *.*, */*.* -cantera = *.pxd +cantera = *.pxd, test/*.txt, examples/*.txt # These options exclude data from the wheel file but not from the sdist [options.exclude_package_data] diff --git a/test/python/test_reactor.py b/test/python/test_reactor.py index 5acad5affe..1cec88fa39 100644 --- a/test/python/test_reactor.py +++ b/test/python/test_reactor.py @@ -1565,7 +1565,7 @@ class CombustorTestImplementation: """ These tests are based on the sample: - interfaces/cython/cantera/examples/reactors/combustor.py + samples/python/reactors/combustor.py with some simplifications so that they run faster and produce more consistent output. @@ -1671,7 +1671,7 @@ class WallTestImplementation: """ These tests are based on the sample: - interfaces/cython/cantera/examples/reactors/reactor2.py + samples/python/reactors/reactor2.py with some simplifications so that they run faster and produce more consistent output.