Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from distutils.command.build to setuptools.command.build #246

Merged
merged 1 commit into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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 ../../
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 0 additions & 3 deletions examples/rust_with_cffi/setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/usr/bin/env python
import platform
import sys

from setuptools import setup
from setuptools_rust import RustExtension

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
5 changes: 3 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions setuptools_rust/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions setuptools_rust/setuptools_ext.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down