Skip to content

Commit d319aa6

Browse files
authored
chore: add python 3.12 (#446)
* chore: only build numpy from sources in build_numpy * chore: add python 3.12 * chore: bump numpy to 1.26.0 for python 3.12 tests
1 parent af2c5a5 commit d319aa6

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
- python: "3.9"
4848
- python: "3.10"
4949
- python: "3.11"
50+
- python: "3.12"
5051
steps:
5152
- name: Checkout
5253
uses: actions/checkout@v3
@@ -61,6 +62,7 @@ jobs:
6162
with:
6263
python-version: "${{ matrix.python }}"
6364
architecture: x64
65+
allow-prereleases: true
6466
- name: Run tests
6567
run: pipx run nox -s tests-${{ matrix.python }}
6668
- name: Upload coverage to codecov

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
nox.options.sessions = ["lint", "test-dist"]
1010

11-
PYTHON_ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
11+
PYTHON_ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
1212
RUNNING_CI = "TRAVIS" in os.environ or "GITHUB_ACTIONS" in os.environ
1313

1414

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66
# enable version inference
77

88
[tool.black]
9-
target-version = ["py37", "py38", "py39", "py310", "py311"]
9+
target-version = ["py37", "py38", "py39", "py310", "py311", "py312"]
1010
extend-exclude = "src/auditwheel/_vendor"
1111

1212
[tool.isort]

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ classifier =
1919
Programming Language :: Python :: 3.9
2020
Programming Language :: Python :: 3.10
2121
Programming Language :: Python :: 3.11
22+
Programming Language :: Python :: 3.12
2223
Programming Language :: Python :: 3 :: Only
2324
Topic :: Software Development
2425
Topic :: Software Development :: Build Tools

tests/integration/test_manylinux.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,14 @@
5252
PYTHON_ABI_MAJ_MIN = "".join(PYTHON_MAJ_MIN)
5353
PYTHON_ABI_FLAGS = "m" if sys.version_info.minor < 8 else ""
5454
PYTHON_ABI = f"cp{PYTHON_ABI_MAJ_MIN}-cp{PYTHON_ABI_MAJ_MIN}{PYTHON_ABI_FLAGS}"
55-
MANYLINUX_PYTHON_IMAGE_ID = f'python:{".".join(PYTHON_MAJ_MIN)}-slim-bullseye'
55+
PYTHON_IMAGE_TAG = ".".join(PYTHON_MAJ_MIN) + (
56+
"-rc" if PYTHON_MAJ_MIN == ["3", "12"] else ""
57+
)
58+
MANYLINUX_PYTHON_IMAGE_ID = f"python:{PYTHON_IMAGE_TAG}-slim-bullseye"
5659
MUSLLINUX_IMAGES = {
5760
"musllinux_1_1": f"quay.io/pypa/musllinux_1_1_{PLATFORM}:latest",
5861
}
59-
MUSLLINUX_PYTHON_IMAGE_ID = f'python:{".".join(PYTHON_MAJ_MIN)}-alpine'
62+
MUSLLINUX_PYTHON_IMAGE_ID = f"python:{PYTHON_IMAGE_TAG}-alpine"
6063
DEVTOOLSET = {
6164
"manylinux_2_5": "devtoolset-2",
6265
"manylinux_2_12": "devtoolset-8",
@@ -82,6 +85,7 @@
8285
"39": "1.21.4",
8386
"310": "1.21.4",
8487
"311": "1.23.4",
88+
"312": "1.26.0",
8589
}
8690
NUMPY_VERSION = NUMPY_VERSION_MAP[PYTHON_ABI_MAJ_MIN]
8791
ORIGINAL_NUMPY_WHEEL = f"numpy-{NUMPY_VERSION}-{PYTHON_ABI}-linux_{PLATFORM}.whl"
@@ -206,6 +210,8 @@ def build_numpy(container, policy, output_dir):
206210
elif policy.startswith("manylinux_2_28_"):
207211
docker_exec(container, "dnf install -y openblas-devel")
208212
else:
213+
if tuple(int(part) for part in NUMPY_VERSION.split(".")[:2]) >= (1, 26):
214+
pytest.skip("numpy>=1.26 requires openblas")
209215
docker_exec(container, "yum install -y atlas atlas-devel")
210216

211217
if op.exists(op.join(WHEEL_CACHE_FOLDER, policy, ORIGINAL_NUMPY_WHEEL)):
@@ -222,7 +228,7 @@ def build_numpy(container, policy, output_dir):
222228

223229
docker_exec(
224230
container,
225-
f"pip wheel -w /io --no-binary=:all: numpy=={NUMPY_VERSION}",
231+
f"pip wheel -w /io --no-binary=numpy numpy=={NUMPY_VERSION}",
226232
)
227233
os.makedirs(op.join(WHEEL_CACHE_FOLDER, policy), exist_ok=True)
228234
shutil.copy2(
@@ -297,6 +303,8 @@ def test_build_repair_numpy(
297303
else:
298304
docker_exec(docker_python, "apt-get update -yqq")
299305
docker_exec(docker_python, "apt-get install -y gfortran")
306+
if tuple(int(part) for part in NUMPY_VERSION.split(".")[:2]) >= (1, 26):
307+
docker_exec(docker_python, "pip install meson ninja")
300308
docker_exec(
301309
docker_python,
302310
"python -m numpy.f2py -c /auditwheel_src/tests/integration/foo.f90 -m foo",

0 commit comments

Comments
 (0)