Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .github/workflows/build-cross-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- 3.10.15
- 3.11.10
- 3.12.5
- 3.13.0
host:
- x86_64
- aarch64
Expand Down Expand Up @@ -119,6 +120,7 @@ jobs:
- 3.10.15
- 3.11.10
- 3.12.5
- 3.13.0
arch:
- x86_64

Expand Down Expand Up @@ -174,6 +176,7 @@ jobs:
- 3.10.15
- 3.11.10
- 3.12.5
- 3.13.0
arch:
- amd64
- x86
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/build-native-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- 3.10.15
- 3.11.10
- 3.12.5
- 3.13.0
host:
- x86_64
- aarch64
Expand Down Expand Up @@ -101,6 +102,7 @@ jobs:
- 3.10.15
- 3.11.10
- 3.12.5
- 3.13.0
arch:
- x86_64

Expand Down Expand Up @@ -157,6 +159,7 @@ jobs:
- 3.10.15
- 3.11.10
- 3.12.5
- 3.13.0
arch:
- arm64

Expand Down Expand Up @@ -212,6 +215,7 @@ jobs:
- 3.10.15
- 3.11.10
- 3.12.5
- 3.13.0
arch:
- amd64
- x86
Expand Down Expand Up @@ -241,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' }}
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/deploy-build-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-fips-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- 3.10.15
- 3.11.10
- 3.12.5
- 3.13.0
arch:
- x86_64
env:
Expand Down
12 changes: 7 additions & 5 deletions relenv/build/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 5 additions & 0 deletions relenv/build/darwin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 5 additions & 0 deletions relenv/build/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
14 changes: 10 additions & 4 deletions relenv/build/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -217,3 +218,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)
12 changes: 11 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright 2023-2024 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0
#
import logging
import os
import platform
import shutil
Expand All @@ -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:
Expand Down Expand Up @@ -42,7 +45,14 @@ 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:
try:
shutil.rmtree(tmp_path)
except Exception as exc:
log.error("Failed to remove build directory %s", exc)


@pytest.fixture
Expand Down
71 changes: 53 additions & 18 deletions tests/test_verify_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,18 @@ 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")
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"
if sys.platform == "linux" and shutil.which("git"):
Expand Down Expand Up @@ -193,7 +201,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.")

Expand Down Expand Up @@ -246,7 +254,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.")

Expand Down Expand Up @@ -323,7 +331,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:
Expand All @@ -338,6 +346,15 @@ 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")

env = os.environ.copy()
env["RELENV_BUILDENV"] = "yes"
env["USE_STATIC_REQUIREMENTS"] = "1"
Expand Down Expand Up @@ -405,6 +422,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"
Expand Down Expand Up @@ -553,9 +573,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
Expand Down Expand Up @@ -943,17 +964,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,
)
Expand All @@ -964,11 +991,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:
Expand Down Expand Up @@ -998,7 +1028,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:
Expand Down Expand Up @@ -1240,6 +1273,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),
Expand Down Expand Up @@ -1307,7 +1342,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(
[
Expand Down
Loading