Skip to content

Commit d7c8fc1

Browse files
authored
Merge pull request #246 from messense/setuptools-build
Switch from `distutils.command.build` to `setuptools.command.build`
2 parents 0767912 + d7cdf44 commit d7c8fc1

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ jobs:
201201
- uses: actions/checkout@master
202202
- name: Build wheels
203203
run: |
204-
echo 'curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
204+
echo 'set -ex
205+
curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
205206
source ~/.cargo/env
206207
rustup target add ${{ matrix.platform.target }}
207208
@@ -212,7 +213,7 @@ jobs:
212213
python3.9 -m pip install crossenv
213214
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
214215
. venv/bin/activate
215-
build-pip install cffi wheel
216+
build-pip install cffi wheel "setuptools>=62.4"
216217
cross-expose cffi
217218
pip install wheel
218219
pip install -e ../../

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Unreleased
44

5+
### Packaging
6+
- Increase minimum `setuptools` version to 62.4. [#222](https://github.com/PyO3/setuptools-rust/pull/246)
7+
58
### Fixed
69
- If the sysconfig for `BLDSHARED` has no flags, `setuptools-rust` won't crash anymore. [#241](https://github.com/PyO3/setuptools-rust/pull/241)
710

examples/rust_with_cffi/setup.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
#!/usr/bin/env python
2-
import platform
3-
import sys
4-
52
from setuptools import setup
63
from setuptools_rust import RustExtension
74

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools>=58.0", "setuptools_scm[toml]>=3.4.3"]
2+
requires = ["setuptools>=62.4", "setuptools_scm[toml]>=3.4.3"]
33
build-backend = "setuptools.build_meta"
44

55
[tool.setuptools_scm]

setup.cfg

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ classifiers =
1818
Programming Language :: Python :: 3.7
1919
Programming Language :: Python :: 3.8
2020
Programming Language :: Python :: 3.9
21+
Programming Language :: Python :: 3.10
2122
Development Status :: 5 - Production/Stable
2223
Operating System :: POSIX
2324
Operating System :: MacOS :: MacOS X
@@ -26,8 +27,8 @@ classifiers =
2627
[options]
2728
packages = setuptools_rust
2829
zip_safe = True
29-
install_requires = setuptools>=58.0; semantic_version>=2.8.2,<3; typing_extensions>=3.7.4.3
30-
setup_requires = setuptools>=58.0; setuptools_scm>=6.3.2
30+
install_requires = setuptools>=62.4; semantic_version>=2.8.2,<3; typing_extensions>=3.7.4.3
31+
setup_requires = setuptools>=62.4; setuptools_scm>=6.3.2
3132
python_requires = >=3.7
3233

3334
[options.entry_points]

setuptools_rust/build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import sys
77
import sysconfig
88
from distutils import log
9-
from distutils.command.build import build as CommandBuild
109
from distutils.errors import (
1110
CompileError,
1211
DistutilsExecError,
@@ -16,6 +15,7 @@
1615
from distutils.sysconfig import get_config_var
1716
from typing import Dict, List, NamedTuple, Optional, cast
1817

18+
from setuptools.command.build import build as CommandBuild # type: ignore[import]
1919
from setuptools.command.build_ext import build_ext as CommandBuildExt
2020
from setuptools.command.build_ext import get_abi3_suffix
2121
from typing_extensions import Literal
@@ -72,7 +72,7 @@ def finalize_options(self) -> None:
7272
super().finalize_options()
7373

7474
if self.plat_name is None:
75-
self.plat_name = cast(
75+
self.plat_name = cast( # type: ignore[no-any-unimported]
7676
CommandBuild, self.get_finalized_command("build")
7777
).plat_name
7878
assert isinstance(self.plat_name, str)

setuptools_rust/setuptools_ext.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import os
22
import subprocess
3-
import sys
43
from distutils import log
54
from distutils.command.clean import clean
6-
from pathlib import Path
75
from typing import List, Tuple, Type, cast
86

97
from setuptools.command.build_ext import build_ext

0 commit comments

Comments
 (0)