From 2a59da1f93f26c2bcdf5c84306ddb61f5fe7ba0a Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Fri, 15 Mar 2024 11:43:43 +0100 Subject: [PATCH] Cancel abi3 changes --- .github/workflows/build.yml | 20 ++++++++------------ extensions.py | 8 +------- setup.py | 14 +------------- 3 files changed, 10 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2234ac8..9d4b54f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,8 +22,7 @@ jobs: strategy: fail-fast: False matrix: - # python-version: [ 3.8, 3.9, '3.10', '3.11' ] - python-version: [ '3.11' ] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - name: Checkout repository uses: actions/checkout@v4 @@ -35,12 +34,9 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install SWIG - run: choco install swig -y - - name: Build wheels run: | - python -m pip install -U pip numpy wheel setuptools + python -m pip install -U pip numpy swig wheel setuptools python setup.py bdist_wheel -d dist ls -al ./dist @@ -62,16 +58,16 @@ jobs: with: submodules: true - - name: Setup Python 3.6 + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: - python-version: '3.6' + python-version: '3.11' - name: Build wheels env: - # only build CPython-3.6+ and skip 32-bit builds and skip windows - CIBW_BUILD: cp36-* - CIBW_SKIP: "*-win* *-manylinux_i686 *-musllinux*" + # only build CPython-3.8+ and skip 32-bit builds + CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-* + CIBW_SKIP: "*-manylinux_i686 *-musllinux*" # use latest build CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2014_x86_64 CIBW_BEFORE_ALL_MACOS: brew install swig @@ -93,7 +89,7 @@ jobs: strategy: matrix: os: [ windows-latest, ubuntu-latest, macos-latest ] - python-version: [ '3.11' ] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - name: Checkout repository diff --git a/extensions.py b/extensions.py index 7a66095..63ae616 100644 --- a/extensions.py +++ b/extensions.py @@ -57,12 +57,6 @@ def build_extension(self, ext: Extension): ext.source_dir.as_posix() ] - if platform.system() == "Windows": - cmd += "-DPYTHON_EXTENSION_MODULE_SUFFIX=.abi3.so" - else: - cmd += "-DPYTHON_EXTENSION_MODULE_SUFFIX=.abi3.pyd" - abi3_flag = "-DPy_LIMITED_API=0x03060000" - if platform.system() == "Windows": cmd.insert(2, f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{self.config.upper()}={_ed}") @@ -71,7 +65,7 @@ def build_extension(self, ext: Extension): cwd=build_dir, env={ **os.environ.copy(), - "CXXFLAGS": f'{os.environ.get("CXXFLAGS", "")} -DVERSION_INFO="{self.distribution.get_version()}" {abi3_flag}' + "CXXFLAGS": f'{os.environ.get("CXXFLAGS", "")} -DVERSION_INFO="{self.distribution.get_version()}"' }) # build the DLL diff --git a/setup.py b/setup.py index 698bc9f..f015eb3 100644 --- a/setup.py +++ b/setup.py @@ -19,22 +19,10 @@ version = ".".join(version) -class bdist_wheel_abi3(bdist_wheel): - def get_tag(self): - python, abi, plat = super().get_tag() - - if python.startswith("cp"): - # on CPython, our wheels are abi3 and compatible back to 3.6 - return "cp36", "abi3", plat - - return python, abi, plat - - setup( version=version, install_requires=["numpy >=1.18.5"], ext_modules=[NLOptBuildExtension("nlopt._nlopt", version)], - cmdclass={"build_ext": NLOptBuild, - "bdist_wheel": bdist_wheel_abi3}, + cmdclass={"build_ext": NLOptBuild}, zip_safe=False, )