diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e405dfa2a..f6a0bf6ff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -377,9 +377,6 @@ jobs: path: dist - name: Upgrade pip run: python3 -m pip install -U pip setuptools wheel - - name: Install typing_extensions for Python 3.7 - if: matrix.python-version == '3.7' - run: python3 -m pip install typing-extensions - name: Install Python dependencies run: | python3 -m pip install numpy ruamel.yaml h5py pandas matplotlib scipy pint diff --git a/interfaces/python_sdist/MANIFEST.in b/interfaces/python_sdist/MANIFEST.in index dc998757e..9b1ae04f4 100644 --- a/interfaces/python_sdist/MANIFEST.in +++ b/interfaces/python_sdist/MANIFEST.in @@ -3,7 +3,6 @@ # listed in setup.cfg:options.exclude_package_data. include cantera/_cantera.cpp -include cantera/_cantera.h recursive-include cantera *.pyx include sundials_config.h.in include config.h.in diff --git a/interfaces/python_sdist/SConscript b/interfaces/python_sdist/SConscript index 0c673ed87..85ac5644c 100644 --- a/interfaces/python_sdist/SConscript +++ b/interfaces/python_sdist/SConscript @@ -170,8 +170,6 @@ sdist(localenv.RecursiveInstall("cantera", exclude=["__pycache__"])) sdist(localenv.RecursiveInstall("cantera/data", "#build/data")) -sdist(localenv.RecursiveInstall("cantera/test/data", - "#test/data")) # Copy the minimal Sundials configuration template into the sdist so that # it can be filled in at compile time on the user's machine diff --git a/interfaces/python_sdist/pyproject.toml b/interfaces/python_sdist/pyproject.toml index a272bb956..1bb9493c6 100644 --- a/interfaces/python_sdist/pyproject.toml +++ b/interfaces/python_sdist/pyproject.toml @@ -1,3 +1,10 @@ [build-system] -requires = ["setuptools>=43.0.0", "wheel", "oldest-supported-numpy", "Cython>=0.29.12"] +# These versions are pinned to the latest versions at the time of this commit. +# Feel free to update as required. +requires = [ + "setuptools==67.7.1", + "wheel", + "oldest-supported-numpy", + "Cython==0.29.34", +] build-backend = "setuptools.build_meta" diff --git a/interfaces/python_sdist/setup.cfg.in b/interfaces/python_sdist/setup.cfg.in index 89ec6775a..77aa5557b 100644 --- a/interfaces/python_sdist/setup.cfg.in +++ b/interfaces/python_sdist/setup.cfg.in @@ -45,15 +45,19 @@ install_requires = packaging python_requires @py_requires_ver_str@ packages = - cantera cantera.data + cantera.examples + cantera.test + cantera.with_units # These options include data in the sdist and wheel if the files are also listed in # MANIFEST.in. Note that only files that are inside the "cantera" packages will be # included in the wheel. [options.package_data] -cantera.data = *.*, */*.* -cantera = *.pxd, test/*.txt, examples/*.txt +cantera = *.pxd +cantera.data = *.* +cantera.examples = *.txt +cantera.test = *.txt # These options exclude data from the wheel file but not from the sdist [options.exclude_package_data] diff --git a/interfaces/python_sdist/setup.py b/interfaces/python_sdist/setup.py index 705d2608f..127297a17 100644 --- a/interfaces/python_sdist/setup.py +++ b/interfaces/python_sdist/setup.py @@ -8,14 +8,13 @@ from pathlib import Path import numpy import shutil -HERE = Path(__file__).parent -CT_SRC = HERE / "src" -EXT_SRC = HERE / "ext" -CT_INCLUDE = HERE / "include" +CT_SRC = Path("src") +EXT_SRC = Path("ext") +CT_INCLUDE = Path("include") BOOST_INCLUDE = None FORCE_CYTHON_COMPILE = False -CYTHON_BUILT_FILES = [HERE / "cantera" / f"_cantera.{ext}" for ext in ("cpp", "h")] +CYTHON_BUILT_FILES = [Path("cantera") / f"_cantera.{ext}" for ext in ("cpp", "h")] class CanteraOptionsMixin: @@ -114,9 +113,6 @@ def configure_build(): config_h = {} - def create_config(key, value): - config_h[key] = f"#define {key} {value}" - if not boost_version: raise ValueError( "Could not find Boost headers. Please set an environment variable called " @@ -134,7 +130,7 @@ def configure_build(): ) if sys.platform != "win32": - extra_compile_flags = ["-std=c++14", "-g0"] + extra_compile_flags = ["-std=c++17", "-g0"] sundials_configh = { "SUNDIALS_USE_GENERIC_MATH": "#define SUNDIALS_USE_GENERIC_MATH 1", "SUNDIALS_BLAS_LAPACK": "/* #undef SUNDIALS_BLAS_LAPACK */" @@ -150,14 +146,14 @@ def configure_build(): } sundials_cflags = [] - sun_config_h_in = (HERE / "sundials_config.h.in").read_text() - sun_config_h = HERE / "sundials_config.h" + sun_config_h_in = Path("sundials_config.h.in").read_text() + sun_config_h = Path("sundials_config.h") sun_config_h.write_text(sun_config_h_in.format_map(sundials_configh)) shutil.copy2(sun_config_h, EXT_SRC / "sundials" / "sundials") shutil.copy2(sun_config_h, CT_INCLUDE / "cantera" / "ext" / "sundials") - config_h_in = (HERE / "config.h.in").read_text() - ct_config_h = HERE / "include" / "cantera" / "base" / "config.h" + config_h_in = Path("config.h.in").read_text() + ct_config_h = Path("include") / "cantera" / "base" / "config.h" ct_config_h.write_text(config_h_in.format_map(config_h)) return extra_compile_flags, sundials_cflags, sundials_macros diff --git a/site_scons/buildutils.py b/site_scons/buildutils.py index 1b560e833..601653338 100644 --- a/site_scons/buildutils.py +++ b/site_scons/buildutils.py @@ -2,7 +2,6 @@ from __future__ import annotations import json import os import sys -import platform import textwrap import re import subprocess