Skip to content

Commit 504ddf4

Browse files
committed
Add support for Python 3.12, drop older than 3.11.5
1 parent 3bae487 commit 504ddf4

File tree

10 files changed

+33
-36
lines changed

10 files changed

+33
-36
lines changed

.github/workflows/test_package.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
fail-fast: false
88
matrix:
99
os: [windows-latest, ubuntu-latest, macos-latest]
10-
embedded-py: [3.9.8, 3.11.5]
10+
embedded-py: [3.11.5, 3.12.3]
1111
conan:
1212
- version: 1
1313
args: lumicks/testing --build=missing

.github/workflows/update_env.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/checkout@v4
2424
- uses: actions/setup-python@v5
2525
with:
26-
python-version: "3.9"
26+
python-version: "3.11"
2727
- name: Compile
2828
run: |
2929
python -m pip install pip-tools==7.4.1

changelog.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Changelog
22

3-
## v1.9.0 | In development
3+
## v1.9.0 | 2024-05-03
44

55
- Added support for Conan v2.
6+
- Added support for Python 3.12.
7+
- Updated default recipe options to `pip` v24.0, `setuptools` v69.5.1, `wheel` v0.43.0, and `pip-licenses` v4.4.0 for compatibility with Python 3.12.
8+
- Dropped support for Python versions older than 3.11.5 in order to avoid maintaining both `openssl` v1 and v3.
69
- Removed the obsolete `openssl_variant` option.
710
- Removed redundant `embedded_python:version` option. Use `embedded_python-core:version`.
811

conanfile.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ class EmbeddedPython(ConanFile):
2626
}
2727
default_options = {
2828
"packages": None,
29-
"pip_version": "23.1.2",
30-
"pip_licenses_version": "4.3.2",
31-
"setuptools_version": "67.8.0",
32-
"wheel_version": "0.40.0",
29+
"pip_version": "24.0",
30+
"pip_licenses_version": "4.4.0",
31+
"setuptools_version": "69.5.1",
32+
"wheel_version": "0.43.0",
3333
}
3434
short_paths = True # some of the pip packages go over the 260 char path limit on Windows
3535
exports_sources = "embedded_python.cmake"
@@ -39,7 +39,7 @@ def requirements(self):
3939

4040
@property
4141
def pyversion(self):
42-
"""Full Python version that we want to package, e.g. 3.11.3"""
42+
"""Full Python version that we want to package, e.g. 3.11.5"""
4343
return scm.Version(self.dependencies["embedded_python-core"].options.version)
4444

4545
@property

core/conanfile.py

+7-18
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class EmbeddedPythonCore(ConanFile):
3030
exports_sources = "embedded_python_tools.py", "embedded_python-core.cmake"
3131

3232
def validate(self):
33-
minimum_python = "3.9.8"
33+
minimum_python = "3.11.5"
3434
if self.pyversion < minimum_python:
3535
raise ConanInvalidConfiguration(f"Minimum supported Python version is {minimum_python}")
3636

@@ -51,26 +51,19 @@ def requirements(self):
5151
if self.settings.os == "Windows":
5252
return # on Windows, we download a binary, so we don't need anything else
5353

54-
self.requires("sqlite3/3.42.0")
54+
self.requires("sqlite3/3.45.3")
5555
self.requires("bzip2/1.0.8")
56-
self.requires("xz_utils/5.4.2")
56+
self.requires("xz_utils/5.4.5")
5757
self.requires("zlib/[>=1.2.11 <2]")
58+
self.requires("openssl/[>=3 <4]")
5859
if self.settings.os == "Linux":
5960
self.requires("libffi/3.4.4")
6061
self.requires("libuuid/1.0.3")
61-
if self.pyversion < "3.8":
62-
self.requires("mpdecimal/2.4.2")
63-
else:
64-
self.requires("mpdecimal/2.5.0")
65-
66-
if self.pyversion >= scm.Version("3.11.0"):
67-
self.requires("openssl/[>=3 <4]")
68-
else:
69-
self.requires("openssl/1.1.1w")
62+
self.requires("mpdecimal/2.5.1")
7063

7164
@property
7265
def pyversion(self):
73-
"""Full Python version that we want to package, e.g. 3.11.3"""
66+
"""Full Python version that we want to package, e.g. 3.11.5"""
7467
return scm.Version(self.options.version)
7568

7669
@property
@@ -221,13 +214,9 @@ def _zip_stdlib(self, prefix):
221214
for pyc_file in (pathlib.Path(root, f) for f in file_names if f.endswith(".pyc")):
222215
zf.write(pyc_file, arcname=str(pyc_file.relative_to(lib)))
223216

224-
def is_landmark(filepath):
225-
"""Older Python version require `os.py(c)` to use as a landmark for the stdlib"""
226-
return self.pyversion < "3.11.0" and filepath.name == "os.pyc"
227-
228217
# Delete everything that we can in `lib`: the `.zip` takes over
229218
for path in lib.iterdir():
230-
if path.is_file() and not is_landmark(path):
219+
if path.is_file():
231220
path.unlink()
232221
elif path.is_dir() and path.name not in keep_lib_dirs:
233222
shutil.rmtree(path)

core/test_package/conanfile.py

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class TestEmbeddedPythonCore(ConanFile):
1111
name = "test_embedded_python"
1212
settings = "os", "compiler", "build_type", "arch"
1313
generators = "CMakeDeps", "VirtualRunEnv"
14-
default_options = {"embedded_python-core/*:version": "3.11.3"}
1514
test_type = "explicit"
1615

1716
def layout(self):

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.black]
22
line-length = 100
3-
target-version = ['py39']
3+
target-version = ['py311']
44
extend-exclude = '''
55
(
66
/(
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nbconvert==7.4.0
1+
nbconvert==7.16.3

test_package/numpy/requirements.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
hypothesis==6.75.3
2-
numpy==1.24.3
3-
pytest-xdist==3.3.1
4-
pytest==7.3.1
5-
typing-extensions==4.5.0
1+
hypothesis==6.100.2
2+
numpy==1.26.4
3+
pytest-xdist==3.5.0
4+
pytest==8.2.0
5+
typing-extensions==4.11.0

test_package/numpy/test.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,11 @@
33
import sys
44
import numpy as np
55

6-
7-
sys.exit(not np.test(verbose=2, extra_argv=["-n", "auto"]))
6+
# `test_mem_policy.py` and `f2py/*` tests fail with Python 3.11 due to `numpy.distutils`
7+
# deprecations and issues with the latest `setuptools`. Ignore it until it's resolves in `numpy`.
8+
sys.exit(
9+
not np.test(
10+
verbose=2,
11+
extra_argv=["-n", "auto", "-k=not test_mem_policy and not f2py"],
12+
)
13+
)

0 commit comments

Comments
 (0)