Skip to content

Commit 52960f0

Browse files
authored
Merge pull request #367 from davidhewitt/test-3.12
ci: test 3.12, pypy 3.10
2 parents a6e82c2 + f018421 commit 52960f0

File tree

7 files changed

+35
-21
lines changed

7 files changed

+35
-21
lines changed

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,8 @@ updates:
2020
directory: "examples/rust_with_cffi"
2121
schedule:
2222
interval: "monthly"
23+
24+
- package-ecosystem: "github-actions"
25+
directory: "/"
26+
schedule:
27+
interval: "monthly"

.github/workflows/ci.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,16 @@ jobs:
6262
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
6363
fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }}
6464
matrix:
65-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12-dev", pypy-3.8, pypy-3.9]
65+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", pypy-3.8, pypy-3.9, pypy-3.10]
6666
platform: [
6767
{ os: "macos-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
6868
{ os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
6969
{ os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
70-
{ os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" },
7170
]
72-
exclude:
73-
# No 32-bit pypy 3.8 on Windows
74-
- python-version: pypy-3.8
75-
platform: { os: "windows-latest", python-architecture: "x86" }
76-
# No 32-bit pypy 3.9 on Windows
77-
- python-version: pypy-3.9
78-
platform: { os: "windows-latest", python-architecture: "x86" }
71+
include:
72+
# Just test one x86 Windows Python for simplicity
73+
- python-version: 3.12
74+
platform: { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" }
7975

8076
steps:
8177
- uses: actions/checkout@v3

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*.pyo
33
*.so
44
.eggs
5-
.tox
5+
.nox
66
dist
77
build
88
target

examples/namespace_package/noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
@nox.session()
99
def test(session: nox.Session):
10-
session.install(SETUPTOOLS_RUST, "wheel", "pytest")
10+
session.install(SETUPTOOLS_RUST, "wheel")
1111
# Ensure build uses version of setuptools-rust under development
12-
session.install("--no-build-isolation", ".")
12+
session.install("--no-build-isolation", ".[dev]")
1313
# Test Python package
1414
session.run("pytest", *session.posargs)

examples/namespace_package/pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ build-backend = "setuptools.build_meta"
66
name="namespace_package"
77
version="0.1.0"
88

9+
[project.optional-dependencies]
10+
dev = ["pytest"]
11+
12+
[tool.pytest.ini_options]
13+
914
[tool.setuptools.packages]
1015
# Pure Python packages/modules
1116
find = { where = ["python"] }

examples/namespace_package/pytest.ini

Whitespace-only changes.

noxfile.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import tarfile
32
from inspect import cleandoc as heredoc
43
from glob import glob
54
from pathlib import Path
@@ -19,24 +18,33 @@ def test_sdist_vendor(session: nox.Session):
1918
session.install(".", "build", "wheel")
2019
namespace_package = Path(__file__).parent / "examples" / "namespace_package"
2120
os.chdir(namespace_package)
22-
tmp = session.create_tmp()
21+
tmp = Path(session.create_tmp())
22+
extra_config = tmp / "setup.cfg"
2323

2424
build_config = """
2525
[sdist]
2626
vendor_crates = True
2727
"""
28-
Path(tmp, "setup.cfg").write_text(heredoc(build_config), encoding="utf-8")
28+
extra_config.write_text(heredoc(build_config), encoding="utf-8")
2929

3030
env = os.environ.copy()
31-
env.update(DIST_EXTRA_CONFIG=str(Path(tmp, "setup.cfg")))
31+
env.update(DIST_EXTRA_CONFIG=str(extra_config))
3232
cmd = ["python", "-m", "build", "--sdist", "--no-isolation"]
3333
session.run(*cmd, env=env, external=True)
3434

35-
dist = namespace_package / "dist"
36-
with tarfile.open(str(dist / "namespace_package-0.1.0.tar.gz")) as tf:
37-
tf.extractall(str(dist))
38-
os.chdir(dist / "namespace_package-0.1.0")
39-
session.run("cargo", "build", "--offline", external=True)
35+
session.run(
36+
"python",
37+
"-m",
38+
"pip",
39+
"install",
40+
Path("dist") / "namespace_package-0.1.0.tar.gz[dev]",
41+
"--no-build-isolation",
42+
"-v",
43+
# run in offline mode with a blank cargo home to prove the vendored
44+
# dependencies are sufficient to build the package
45+
env={"CARGO_NET_OFFLINE": "true", "CARGO_HOME": str(tmp / ".cargo")},
46+
)
47+
session.run("pytest")
4048

4149

4250
@nox.session(name="test-crossenv", venv_backend=None)

0 commit comments

Comments
 (0)