diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d104046..c58c03f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -201,7 +201,8 @@ jobs: - uses: actions/checkout@master - name: Build wheels run: | - echo 'curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable + echo 'set -ex + curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable source ~/.cargo/env rustup target add ${{ matrix.platform.target }} @@ -212,7 +213,7 @@ jobs: python3.9 -m pip install crossenv python3.9 -m crossenv "/opt/python/cp39-cp39/bin/python3" --cc $TARGET_CC --cxx $TARGET_CXX --sysroot $TARGET_SYSROOT --env LIBRARY_PATH= --manylinux manylinux1 venv . venv/bin/activate - build-pip install cffi wheel + build-pip install cffi wheel "setuptools>=62.4" cross-expose cffi pip install wheel pip install -e ../../ diff --git a/CHANGELOG.md b/CHANGELOG.md index 80dac190..8ecf9ff4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +### Packaging +- Increase minimum `setuptools` version to 62.4. [#222](https://github.com/PyO3/setuptools-rust/pull/246) + ### Fixed - If the sysconfig for `BLDSHARED` has no flags, `setuptools-rust` won't crash anymore. [#241](https://github.com/PyO3/setuptools-rust/pull/241) diff --git a/examples/rust_with_cffi/setup.py b/examples/rust_with_cffi/setup.py index 6479b15a..6e4b388f 100644 --- a/examples/rust_with_cffi/setup.py +++ b/examples/rust_with_cffi/setup.py @@ -1,7 +1,4 @@ #!/usr/bin/env python -import platform -import sys - from setuptools import setup from setuptools_rust import RustExtension diff --git a/pyproject.toml b/pyproject.toml index a1d016bb..00674551 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=58.0", "setuptools_scm[toml]>=3.4.3"] +requires = ["setuptools>=62.4", "setuptools_scm[toml]>=3.4.3"] build-backend = "setuptools.build_meta" [tool.setuptools_scm] diff --git a/setup.cfg b/setup.cfg index 0409a1d5..af86b15f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,6 +18,7 @@ classifiers = Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 Development Status :: 5 - Production/Stable Operating System :: POSIX Operating System :: MacOS :: MacOS X @@ -26,8 +27,8 @@ classifiers = [options] packages = setuptools_rust zip_safe = True -install_requires = setuptools>=58.0; semantic_version>=2.8.2,<3; typing_extensions>=3.7.4.3 -setup_requires = setuptools>=58.0; setuptools_scm>=6.3.2 +install_requires = setuptools>=62.4; semantic_version>=2.8.2,<3; typing_extensions>=3.7.4.3 +setup_requires = setuptools>=62.4; setuptools_scm>=6.3.2 python_requires = >=3.7 [options.entry_points] diff --git a/setuptools_rust/build.py b/setuptools_rust/build.py index 8eb26c68..5fd6af8d 100644 --- a/setuptools_rust/build.py +++ b/setuptools_rust/build.py @@ -6,7 +6,6 @@ import sys import sysconfig from distutils import log -from distutils.command.build import build as CommandBuild from distutils.errors import ( CompileError, DistutilsExecError, @@ -16,6 +15,7 @@ from distutils.sysconfig import get_config_var from typing import Dict, List, NamedTuple, Optional, cast +from setuptools.command.build import build as CommandBuild # type: ignore[import] from setuptools.command.build_ext import build_ext as CommandBuildExt from setuptools.command.build_ext import get_abi3_suffix from typing_extensions import Literal @@ -72,7 +72,7 @@ def finalize_options(self) -> None: super().finalize_options() if self.plat_name is None: - self.plat_name = cast( + self.plat_name = cast( # type: ignore[no-any-unimported] CommandBuild, self.get_finalized_command("build") ).plat_name assert isinstance(self.plat_name, str) diff --git a/setuptools_rust/setuptools_ext.py b/setuptools_rust/setuptools_ext.py index 6dae5860..c0f619cc 100644 --- a/setuptools_rust/setuptools_ext.py +++ b/setuptools_rust/setuptools_ext.py @@ -1,9 +1,7 @@ import os import subprocess -import sys from distutils import log from distutils.command.clean import clean -from pathlib import Path from typing import List, Tuple, Type, cast from setuptools.command.build_ext import build_ext