Skip to content
Open
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
11 changes: 2 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ jobs:
matrix:
python-version:
[
"3.9",
"3.10",
"3.11",
"3.14",
"3.13",
"3.13t",
"3.14",
"3.14t",
"3.15",
"3.15t",
"pypy-3.11",
"graalpy25.0",
]
Expand Down Expand Up @@ -131,14 +132,6 @@ jobs:
rust-target: "aarch64-unknown-linux-gnu",
}
exclude:
# macOS arm doesn't have Python builds before 3.10
- python-version: 3.9
platform:
{
os: "macos-latest",
python-architecture: "arm64",
rust-target: "aarch64-apple-darwin",
}
# no graalpy available on Windows
- python-version: graalpy25.0
platform:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Unreleased
### Packaging
- Drop support for Python 3.9.
- Bump `setuptools` minimum version to 83.0.

## 1.13.0 (2026-06-27)
### Added
- Add `generated-files` option to `RustExtension` to copy files from the build script output directory to the wheel. [#574](https://github.com/PyO3/setuptools-rust/pull/574)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
pyo3 = "0.25"
pyo3 = "0.28"

[lib]
name = "_lib" # private module to be nested into Python package,
Expand Down
2 changes: 0 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,10 @@ def basetext(o):
for t in node.traverse(basetext):
t1 = Text(t.replace(DOCS_URL, "", 1), t.rawsource)
t.parent.replace(t, t1)
return


# end of class


def setup(app):
app.add_transform(RelativeDocLinks)
return
2 changes: 1 addition & 1 deletion examples/generated-files/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
build = "build.rs"

[dependencies]
pyo3 = "0.27"
pyo3 = "0.28"

[lib]
name = "_lib" # private module to be nested into Python package
Expand Down
3 changes: 2 additions & 1 deletion examples/generated-files/python/generated_files/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
__all__ = ["library_ok", "data_files_content"]
__all__ = ["data_files_content", "library_ok"]

from pathlib import Path

from ._lib import library_ok


Expand Down
1 change: 1 addition & 0 deletions examples/generated-files/tests/test_lib.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pathlib import Path

import generated_files


Expand Down
12 changes: 7 additions & 5 deletions examples/html-py-ever/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ name = "html-py-ever"
version = "0.1.0"
license = { text = "MIT" }
readme = "README.md"
requires-python = ">=3.6"
requires-python = ">=3.10"
classifiers = [
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Development Status :: 5 - Production/Stable",
"Operating System :: POSIX",
"Operating System :: MacOS :: MacOS X",
Expand Down
1 change: 1 addition & 0 deletions examples/html-py-ever/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys

import pytest

if sys.platform == "emscripten":
Expand Down
5 changes: 2 additions & 3 deletions examples/html-py-ever/tests/run_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os
from glob import glob
from time import perf_counter
from typing import Tuple

import html_py_ever
from bs4 import BeautifulSoup
Expand All @@ -13,7 +12,7 @@
lxml = None


def rust(filename: str) -> Tuple[int, float, float]:
def rust(filename: str) -> tuple[int, float, float]:
start_load = perf_counter()
doc = html_py_ever.parse_file(filename)
end_load = perf_counter()
Expand All @@ -25,7 +24,7 @@ def rust(filename: str) -> Tuple[int, float, float]:
return len(links), end_load - start_load, end_search - start_search


def python(filename: str, parser: str) -> Tuple[int, float, float]:
def python(filename: str, parser: str) -> tuple[int, float, float]:
start_load = perf_counter()
with open(filename, encoding="utf8") as fp:
soup = BeautifulSoup(fp, parser)
Expand Down
3 changes: 1 addition & 2 deletions examples/html-py-ever/tests/test_parsing.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/usr/bin/env python
from glob import glob
import os
from glob import glob

import html_py_ever
import pytest
from bs4 import BeautifulSoup
from html_py_ever import Document


HTML_FILES = glob(os.path.join(os.path.dirname(__file__), "*.html"))


Expand Down
2 changes: 1 addition & 1 deletion examples/namespace_package/tests/test_namespace_package.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from namespace_package import rust, python
from namespace_package import python, rust


def test_rust():
Expand Down
1 change: 0 additions & 1 deletion examples/rust_with_cffi/cffi_module.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import cffi


ffi = cffi.FFI()
ffi.cdef(
"""
Expand Down
2 changes: 1 addition & 1 deletion examples/rust_with_cffi/setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
from setuptools import find_packages, setup

from setuptools_rust import RustExtension

setup(
Expand Down
8 changes: 4 additions & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import os
from contextlib import ExitStack
from inspect import cleandoc as heredoc
from glob import glob
from pathlib import Path
import shutil
import sys
import tempfile
from contextlib import ExitStack
from glob import glob
from inspect import cleandoc as heredoc
from pathlib import Path

import nox
import nox.command
Expand Down
10 changes: 6 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "setuptools-rust"
version = "1.13.0"
description = "Setuptools Rust extension plugin"
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.10"
keywords = ["distutils", "setuptools", "rust"]
authors = [
{name = "Nikolay Kim", email = "fafhrd91@gmail.com"},
Expand All @@ -13,18 +13,20 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Development Status :: 5 - Production/Stable",
"Operating System :: POSIX",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
]

dependencies = [
"setuptools>=62.4",
"setuptools>=83.0",
"semantic_version>=2.8.2,<3",
]

Expand Down
12 changes: 6 additions & 6 deletions setuptools_rust/_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import subprocess
from typing import Any, Optional, Union, cast
from typing import Any, cast


class Env:
Expand All @@ -8,9 +8,9 @@ class Env:
Dictionaries are unhashable, but ``functools.lru_cache`` needs all parameters to
be hashable, which we solve which a custom ``__hash__``."""

env: Optional[dict[str, str]]
env: dict[str, str] | None

def __init__(self, env: Optional[dict[str, str]]):
def __init__(self, env: dict[str, str] | None):
self.env = env

def __eq__(self, other: object) -> bool:
Expand All @@ -26,17 +26,17 @@ def __hash__(self) -> int:


def run_subprocess(
*args: Any, env: Union[Env, dict[str, str], None], **kwargs: Any
*args: Any, env: Env | dict[str, str] | None, **kwargs: Any
) -> subprocess.CompletedProcess:
"""Wrapper around subprocess.run that requires a decision to pass env."""
if isinstance(env, Env):
env = env.env
kwargs["env"] = env
return subprocess.run(*args, **kwargs) # noqa: TID251 # this is a wrapper to implement the rule
return subprocess.run(*args, **kwargs) # noqa: PLW1510, TID251 # this is a wrapper to implement the rule


def check_subprocess_output(
*args: Any, env: Union[Env, dict[str, str], None], **kwargs: Any
*args: Any, env: Env | dict[str, str] | None, **kwargs: Any
) -> str:
"""Wrapper around subprocess.run that requires a decision to pass env."""
if isinstance(env, Env):
Expand Down
Loading
Loading