From 427c5bc9fee55f98c64c12e66694db533f3b94ee Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Fri, 18 Oct 2024 15:33:32 -0700 Subject: [PATCH 1/8] Add python 3.13.0 --- .github/workflows/build-cross-action.yml | 3 +++ .github/workflows/build-native-action.yml | 4 ++++ .github/workflows/deploy-build-action.yml | 18 ++++++++++++++++++ .github/workflows/test-fips-action.yml | 1 + relenv/build/darwin.py | 5 +++++ relenv/build/linux.py | 5 +++++ relenv/build/windows.py | 5 +++++ 7 files changed, 41 insertions(+) diff --git a/.github/workflows/build-cross-action.yml b/.github/workflows/build-cross-action.yml index 7c0eb314..2d1d9ea3 100644 --- a/.github/workflows/build-cross-action.yml +++ b/.github/workflows/build-cross-action.yml @@ -22,6 +22,7 @@ jobs: - 3.10.15 - 3.11.10 - 3.12.5 + - 3.13.0 host: - x86_64 - aarch64 @@ -119,6 +120,7 @@ jobs: - 3.10.15 - 3.11.10 - 3.12.5 + - 3.13.0 arch: - x86_64 @@ -174,6 +176,7 @@ jobs: - 3.10.15 - 3.11.10 - 3.12.5 + - 3.13.0 arch: - amd64 - x86 diff --git a/.github/workflows/build-native-action.yml b/.github/workflows/build-native-action.yml index 8849cd33..b98351d7 100644 --- a/.github/workflows/build-native-action.yml +++ b/.github/workflows/build-native-action.yml @@ -19,6 +19,7 @@ jobs: - 3.10.15 - 3.11.10 - 3.12.5 + - 3.13.0 host: - x86_64 - aarch64 @@ -101,6 +102,7 @@ jobs: - 3.10.15 - 3.11.10 - 3.12.5 + - 3.13.0 arch: - x86_64 @@ -157,6 +159,7 @@ jobs: - 3.10.15 - 3.11.10 - 3.12.5 + - 3.13.0 arch: - arm64 @@ -212,6 +215,7 @@ jobs: - 3.10.15 - 3.11.10 - 3.12.5 + - 3.13.0 arch: - amd64 - x86 diff --git a/.github/workflows/deploy-build-action.yml b/.github/workflows/deploy-build-action.yml index addc9c9e..ed868c70 100644 --- a/.github/workflows/deploy-build-action.yml +++ b/.github/workflows/deploy-build-action.yml @@ -29,6 +29,9 @@ jobs: - platform: linux-gnu arch: x86_64 python: 3.12.5 + - platform: linux-gnu + arch: x86_64 + python: 3.13.0 - platform: linux-gnu arch: aarch64 python: 3.10.15 @@ -38,6 +41,9 @@ jobs: - platform: linux-gnu arch: aarch64 python: 3.12.5 + - platform: linux-gnu + arch: aarch64 + python: 3.13.0 - platform: win arch: x86 @@ -48,6 +54,9 @@ jobs: - platform: win arch: x86 python: 3.12.5 + - platform: win + arch: x86 + python: 3.13.0 - platform: win arch: amd64 python: 3.10.15 @@ -57,6 +66,9 @@ jobs: - platform: win arch: amd64 python: 3.12.5 + - platform: win + arch: amd64 + python: 3.13.0 - platform: macos arch: x86_64 @@ -67,6 +79,9 @@ jobs: - platform: macos arch: x86_64 python: 3.12.5 + - platform: macos + arch: x86_64 + python: 3.13.0 - platform: macos arch: arm64 python: 3.10.15 @@ -76,6 +91,9 @@ jobs: - platform: macos arch: arm64 python: 3.12.5 + - platform: macos + arch: arm64 + python: 3.13.0 steps: - name: Download Artifacts diff --git a/.github/workflows/test-fips-action.yml b/.github/workflows/test-fips-action.yml index cddf631e..f8fb104f 100644 --- a/.github/workflows/test-fips-action.yml +++ b/.github/workflows/test-fips-action.yml @@ -16,6 +16,7 @@ jobs: - 3.10.15 - 3.11.10 - 3.12.5 + - 3.13.0 arch: - x86_64 env: diff --git a/relenv/build/darwin.py b/relenv/build/darwin.py index 759dc816..52f56994 100644 --- a/relenv/build/darwin.py +++ b/relenv/build/darwin.py @@ -139,3 +139,8 @@ def build_python(env, dirs, logfp): version="3.12.5", checksum="d9b83c17a717e1cbd3ab6bd14cfe3e508e6d87b2" ) builds.add("darwin", builder=build) + +build = build.copy( + version="3.13.0", checksum="0f71dce4a3251460985a944bbd1d1b7db1660a91" +) +builds.add("darwin", builder=build) diff --git a/relenv/build/linux.py b/relenv/build/linux.py index 5ae50839..fc4387ae 100644 --- a/relenv/build/linux.py +++ b/relenv/build/linux.py @@ -674,3 +674,8 @@ def build_python(env, dirs, logfp): version="3.12.5", checksum="d9b83c17a717e1cbd3ab6bd14cfe3e508e6d87b2" ) builds.add("linux", builder=build) + +build = build.copy( + version="3.13.0", checksum="0f71dce4a3251460985a944bbd1d1b7db1660a91" +) +builds.add("linux", builder=build) diff --git a/relenv/build/windows.py b/relenv/build/windows.py index 07b48d7f..129e5b21 100644 --- a/relenv/build/windows.py +++ b/relenv/build/windows.py @@ -217,3 +217,8 @@ def runpip(pkg): version="3.12.5", checksum="d9b83c17a717e1cbd3ab6bd14cfe3e508e6d87b2" ) builds.add("win32", builder=build) + +build = build.copy( + version="3.13.0", checksum="0f71dce4a3251460985a944bbd1d1b7db1660a91" +) +builds.add("win32", builder=build) From fff740216b029720f8e0ebe97ee2f4b0424ccfd9 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Fri, 18 Oct 2024 19:19:00 -0700 Subject: [PATCH 2/8] Skip cgi.py if it does not exist --- relenv/build/common.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/relenv/build/common.py b/relenv/build/common.py index 8851d4f4..2a604712 100644 --- a/relenv/build/common.py +++ b/relenv/build/common.py @@ -1495,11 +1495,13 @@ def find_pythonlib(libdir): format_shebang("../../../bin/python3"), ) - patch_shebang( - str(pymodules / "cgi.py"), - "#! /usr/local/bin/python", - format_shebang("../../bin/python3"), - ) + # Moved in python 3.13 or removed? + if (pymodules / "cgi.py").exists(): + patch_shebang( + str(pymodules / "cgi.py"), + "#! /usr/local/bin/python", + format_shebang("../../bin/python3"), + ) def runpip(pkg, upgrade=False): logfp.write(f"\nRUN PIP {pkg} {upgrade}\n") From 36808c002ebd4319bd8ce461bb45e1a7edcc1b4d Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 21 Oct 2024 02:20:32 -0700 Subject: [PATCH 3/8] test fixes for python 3.13.0 --- tests/conftest.py | 6 +++- tests/test_verify_build.py | 57 ++++++++++++++++++++++++++------------ 2 files changed, 45 insertions(+), 18 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index eb17253c..76168d3c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -42,7 +42,11 @@ def minor_version(): @pytest.fixture def build(tmp_path, build_version): create("test", tmp_path, version=build_version) - yield tmp_path / "test" + os.chdir(tmp_path / "test") + try: + yield tmp_path / "test" + finally: + shutil.rmtree(tmp_path) @pytest.fixture diff --git a/tests/test_verify_build.py b/tests/test_verify_build.py index 721fd854..97babb2b 100644 --- a/tests/test_verify_build.py +++ b/tests/test_verify_build.py @@ -97,6 +97,9 @@ def test_pip_install_salt_git(pipexec, build, build_dir, pyexec, build_version): pytest.xfail("Salt does not work with 3.11 or 3.12 on windows yet") if sys.platform == "darwin" and "3.12" in build_version: pytest.xfail("Salt does not work with 3.12 on macos yet") + # if "3.13" in build_version: + # pytest.xfail("Salt does not work with 3.13 yet") + env = os.environ.copy() env["RELENV_BUILDENV"] = "yes" if sys.platform == "linux" and shutil.which("git"): @@ -193,7 +196,7 @@ def test_pip_install_salt_w_static_requirements( if sys.platform == "darwin" and salt_branch in ["3006.x"]: pytest.xfail("Known failure") - for py_version in ("3.11", "3.12"): + for py_version in ("3.11", "3.12", "3.13"): if build_version.startswith(py_version): pytest.xfail(f"{py_version} builds fail.") @@ -246,7 +249,7 @@ def test_pip_install_salt_w_package_requirements( pipexec, tmp_path, salt_branch, build_version ): - for py_version in ("3.11", "3.12"): + for py_version in ("3.11", "3.12", "3.13"): if build_version.startswith(py_version): pytest.xfail(f"{py_version} builds fail.") @@ -323,7 +326,7 @@ def test_pip_install_salt_w_package_requirements( # assert script.exists() -@pytest.mark.parametrize("pyzmq_version", ["23.2.0", "25.1.2"]) +@pytest.mark.parametrize("pyzmq_version", ["23.2.0", "25.1.2", "26.2.0"]) def test_pip_install_pyzmq(pipexec, pyzmq_version, build_version, arch): if pyzmq_version == "23.2.0" and "3.12" in build_version: @@ -338,6 +341,11 @@ def test_pip_install_pyzmq(pipexec, pyzmq_version, build_version, arch): if sys.platform == "win32" and pyzmq_version == "23.2.0": pytest.xfail("vcredist not found as of 9/9/24") + if pyzmq_version == "23.2.0" and "3.13" in build_version: + pytest.xfail(f"{pyzmq_version} does not install on 3.13") + if pyzmq_version == "25.1.2" and "3.13" in build_version: + pytest.xfail(f"{pyzmq_version} does not install on 3.13") + env = os.environ.copy() env["RELENV_BUILDENV"] = "yes" env["USE_STATIC_REQUIREMENTS"] = "1" @@ -553,9 +561,10 @@ def validate_shebang(path): path = build / "bin" / "pip3" assert path.exists() assert validate_shebang(path) - path = build / "lib" / f"python{minor_version}" / "cgi.py" - assert path.exists() - assert validate_shebang(path) + if "3.13" not in minor_version: + path = build / "lib" / f"python{minor_version}" / "cgi.py" + assert path.exists() + assert validate_shebang(path) if sys.platform == "linux": path = ( build @@ -943,17 +952,23 @@ def test_install_with_target_uninstall(pipexec, build): assert not (extras / "bin" / "cowsay").exists() -def test_install_with_target_cffi_versions(pipexec, pyexec, build): +def test_install_with_target_cffi_versions(pipexec, pyexec, build, build_version): env = os.environ.copy() env["RELENV_DEBUG"] = "yes" extras = build / "extras" + if "3.13" not in build_version: + subprocess.run( + [str(pipexec), "install", "cffi==1.14.6"], + check=True, + env=env, + ) + subprocess.run( + [str(pipexec), "install", "cffi==1.16.0", f"--target={extras}"], + check=True, + env=env, + ) subprocess.run( - [str(pipexec), "install", "cffi==1.14.6"], - check=True, - env=env, - ) - subprocess.run( - [str(pipexec), "install", "cffi==1.16.0", f"--target={extras}"], + [str(pipexec), "install", "cffi==1.17.1", f"--target={extras}"], check=True, env=env, ) @@ -964,11 +979,14 @@ def test_install_with_target_cffi_versions(pipexec, pyexec, build): env=env, capture_output=True, ) - proc.stdout.decode().strip() == "1.16.0" + proc.stdout.decode().strip() == "1.17.1" def test_install_with_target_no_ignore_installed(pipexec, pyexec, build, build_version): - if build_version.startswith("3.12"): + if build_version.startswith("3.13"): + cffi = "cffi==1.17.1" + pygit2 = "pygit2==1.16.0" + elif build_version.startswith("3.12"): cffi = "cffi==1.16.0" pygit2 = "pygit2==1.14.0" else: @@ -998,7 +1016,10 @@ def test_install_with_target_no_ignore_installed(pipexec, pyexec, build, build_v def test_install_with_target_ignore_installed(pipexec, pyexec, build, build_version): - if build_version.startswith("3.12"): + if build_version.startswith("3.13"): + cffi = "cffi==1.17.1" + pygit2 = "pygit2==1.16.0" + elif build_version.startswith("3.12"): cffi = "cffi==1.16.0" pygit2 = "pygit2==1.14.0" else: @@ -1240,6 +1261,8 @@ def test_install_with_target_namespaces(pipexec, build, minor_version, build_ver @pytest.mark.skip_unless_on_linux def test_debugpy(pipexec, build, minor_version): + if "3.13" in minor_version: + pytest.xfail("Failes on python 3.13.0") p = subprocess.run( [ str(pipexec), @@ -1307,7 +1330,7 @@ def test_install_mysqlclient(pipexec, build, minor_version): @pytest.mark.skip_unless_on_linux def test_install_m2crypto(pipexec, build, minor_version): - version = "0.41.0" + version = "0.42.0" extras = build / "extras" p = subprocess.run( [ From 76d17fe753abced9792938b080f2af4516992791 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 21 Oct 2024 02:53:07 -0700 Subject: [PATCH 4/8] me --- tests/conftest.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 76168d3c..65a43f34 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,7 @@ # Copyright 2023-2024 VMware, Inc. # SPDX-License-Identifier: Apache-2.0 # +import logging import os import platform import shutil @@ -11,6 +12,8 @@ from relenv.common import list_archived_builds, plat_from_triplet from relenv.create import create +log = logging.getLogger(__name__) + def get_build_version(): if "RELENV_PY_VERSION" in os.environ: @@ -46,7 +49,10 @@ def build(tmp_path, build_version): try: yield tmp_path / "test" finally: - shutil.rmtree(tmp_path) + try: + shutil.rmtree(tmp_path) + except Exception as exc: + log.error("Failed to remove build directory %s", exc) @pytest.fixture From 24c731441de751597f51eeb0d013b9d2c5d4f43b Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 21 Oct 2024 13:33:24 -0700 Subject: [PATCH 5/8] Fix tests and debug windows build --- .github/workflows/build-native-action.yml | 2 +- tests/test_verify_build.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-native-action.yml b/.github/workflows/build-native-action.yml index b98351d7..31fa3e84 100644 --- a/.github/workflows/build-native-action.yml +++ b/.github/workflows/build-native-action.yml @@ -245,7 +245,7 @@ jobs: env: RELENV_NATIVE_PY_VERSION: 3.10.12 run: | - python -m relenv build --arch=${{ matrix.arch }} --python=${{ matrix.version }} + python -m relenv build --no-pretty --arch=${{ matrix.arch }} --python=${{ matrix.version }} - name: Verify Build if: ${{ matrix.arch == 'amd64' }} diff --git a/tests/test_verify_build.py b/tests/test_verify_build.py index 97babb2b..da73552e 100644 --- a/tests/test_verify_build.py +++ b/tests/test_verify_build.py @@ -97,8 +97,8 @@ def test_pip_install_salt_git(pipexec, build, build_dir, pyexec, build_version): pytest.xfail("Salt does not work with 3.11 or 3.12 on windows yet") if sys.platform == "darwin" and "3.12" in build_version: pytest.xfail("Salt does not work with 3.12 on macos yet") - # if "3.13" in build_version: - # pytest.xfail("Salt does not work with 3.13 yet") + if sys.platform == "darwin" and "3.13" in build_version: + pytest.xfail("Salt does not work with 3.13 on macos yet") env = os.environ.copy() env["RELENV_BUILDENV"] = "yes" @@ -341,8 +341,12 @@ def test_pip_install_pyzmq(pipexec, pyzmq_version, build_version, arch): if sys.platform == "win32" and pyzmq_version == "23.2.0": pytest.xfail("vcredist not found as of 9/9/24") + if sys.platform == "win32" and pyzmq_version == "26.2.0": + pytest.xfail("vcredist not found as of 9/9/24") + if pyzmq_version == "23.2.0" and "3.13" in build_version: pytest.xfail(f"{pyzmq_version} does not install on 3.13") + if pyzmq_version == "25.1.2" and "3.13" in build_version: pytest.xfail(f"{pyzmq_version} does not install on 3.13") @@ -413,6 +417,9 @@ def test_pip_install_salt_pip_dir(pipexec, build, build_version, arch): if sys.platform == "win32" and arch == "amd64": pytest.xfail("Known failure on windows amd64") + if sys.platform == "darwin" and "3.13" in build_version: + pytest.xfail("Salt does not work with 3.13 on macos yet") + env = os.environ.copy() env["RELENV_BUILDENV"] = "yes" env["RELENV_DEBUG"] = "yes" From 7ed4c1d7d6013cdad6426f9de478d8c46e3bd448 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 21 Oct 2024 13:37:09 -0700 Subject: [PATCH 6/8] Attempt to fix 3.13 windows build --- relenv/build/windows.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/relenv/build/windows.py b/relenv/build/windows.py index 129e5b21..cfce048b 100644 --- a/relenv/build/windows.py +++ b/relenv/build/windows.py @@ -100,10 +100,11 @@ def build_python(env, dirs, logfp): dst=str(dirs.prefix / "Include"), dirs_exist_ok=True, ) - shutil.copy( - src=str(dirs.source / "PC" / "pyconfig.h"), - dst=str(dirs.prefix / "Include"), - ) + if "3.13" not in env["RELENV_PY_MAJOR_VERSION"]: + shutil.copy( + src=str(dirs.source / "PC" / "pyconfig.h"), + dst=str(dirs.prefix / "Include"), + ) # Copy library files shutil.copytree( From 706741a10bf3495930fd8a3542af3e878df00d8c Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 21 Oct 2024 13:58:08 -0700 Subject: [PATCH 7/8] skip test on windows --- tests/test_verify_build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_verify_build.py b/tests/test_verify_build.py index da73552e..d8a1f52b 100644 --- a/tests/test_verify_build.py +++ b/tests/test_verify_build.py @@ -93,7 +93,7 @@ def test_imports(pyexec): def test_pip_install_salt_git(pipexec, build, build_dir, pyexec, build_version): - if sys.platform == "win32" and "3.11" in build_version or "3.12" in build_version: + if sys.platform == "win32" and "3.11" in build_version or "3.12" in build_version or "3.13" in build_version: pytest.xfail("Salt does not work with 3.11 or 3.12 on windows yet") if sys.platform == "darwin" and "3.12" in build_version: pytest.xfail("Salt does not work with 3.12 on macos yet") From 59df81c854b4b61f06226a8684971bcddf9ad5c7 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Mon, 21 Oct 2024 14:12:30 -0700 Subject: [PATCH 8/8] Fix pre-commit --- tests/test_verify_build.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_verify_build.py b/tests/test_verify_build.py index d8a1f52b..d8e38c39 100644 --- a/tests/test_verify_build.py +++ b/tests/test_verify_build.py @@ -93,7 +93,12 @@ def test_imports(pyexec): def test_pip_install_salt_git(pipexec, build, build_dir, pyexec, build_version): - if sys.platform == "win32" and "3.11" in build_version or "3.12" in build_version or "3.13" in build_version: + if ( + sys.platform == "win32" + and "3.11" in build_version + or "3.12" in build_version + or "3.13" in build_version + ): pytest.xfail("Salt does not work with 3.11 or 3.12 on windows yet") if sys.platform == "darwin" and "3.12" in build_version: pytest.xfail("Salt does not work with 3.12 on macos yet")