Fix errors due to setuptools 61.0

Something changed in setuptools that causes the old method of forcing
platform-specific wheels to be built to break for certain configurations
(specifically, Windows builds with Python 3.7). This alternative approach
appears to be more robust.

Also increase the logging from 'pip wheel' to help with debugging
This commit is contained in:
Ray Speth
2022-03-29 08:59:42 -04:00
committed by Bryan Weber
parent af4fbd25ea
commit d30b76a96a
3 changed files with 10 additions and 5 deletions

View File

@@ -492,7 +492,7 @@ jobs:
architecture: x64
- name: Install Python dependencies
run: |
python -m pip install -U pip 'setuptools>=43.0.0' wheel
python -m pip install -U pip setuptools wheel
python -m pip install scons pypiwin32 numpy ruamel.yaml cython h5py pandas pytest pytest-github-actions-annotate-failures
- name: Restore Boost cache
uses: actions/cache@v2

View File

@@ -102,7 +102,7 @@ ext = localenv.LoadableModule(f"cantera/_cantera{module_ext}",
obj, LIBPREFIX="", SHLIBSUFFIX=module_ext,
SHLIBPREFIX="", LIBSUFFIXES=[module_ext])
build_cmd = ("$python_cmd_esc -m pip wheel --no-build-isolation --no-deps "
build_cmd = ("$python_cmd_esc -m pip wheel -v --no-build-isolation --no-deps "
"--wheel-dir=build/python/dist build/python")
plat = info['plat'].replace('-', '_').replace('.', '_')
wheel_name = (f"Cantera-{env['cantera_version']}-cp{py_version_nodot}"

View File

@@ -1,5 +1,10 @@
from setuptools import setup, Extension
from setuptools import setup
from setuptools.dist import Distribution
extension = Extension("cantera._cantera", sources=[])
class BinaryDistribution(Distribution):
def has_ext_modules(self):
return True
setup(ext_modules=[extension])
setup(
distclass=BinaryDistribution,
)