From 2a5c6d9dc81fe046b013a95baa3a1b800c9ed341 Mon Sep 17 00:00:00 2001 From: Russell Bunch Date: Mon, 4 Nov 2024 11:40:36 -0600 Subject: [PATCH] Support Python 3.11 and 3.12 --- .github/workflows/lint.yml | 2 +- .github/workflows/promote-release.yml | 2 +- .github/workflows/tests.yml | 4 ++-- Jenkinsfile.github | 26 ++++++++++++++------------ Makefile | 2 +- pyproject.toml | 2 ++ 6 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d9c6e67f1..67cc91f2c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -30,7 +30,7 @@ jobs: name: Lint strategy: matrix: - version: ['3.10', '3.9'] + version: ['3.12', '3.11', '3.10', '3.9''] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/promote-release.yml b/.github/workflows/promote-release.yml index 93899354d..e734f3c6e 100644 --- a/.github/workflows/promote-release.yml +++ b/.github/workflows/promote-release.yml @@ -42,7 +42,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.12' - name: nox env: GIT_REPO_NAME: "${GITHUB_REPOSITORY#*/}" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 644851321..13644fd47 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,7 +32,7 @@ jobs: name: Tests and Coverage strategy: matrix: - version: ['3.10', '3.9'] + version: ['3.12', '3.11', '3.10', '3.9'] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -52,7 +52,7 @@ jobs: integration_tests: strategy: matrix: - version: ['3.10', '3.9'] + version: ['3.12', '3.11', '3.10', '3.9'] os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: diff --git a/Jenkinsfile.github b/Jenkinsfile.github index 9f7d778d2..3f58cdc1a 100644 --- a/Jenkinsfile.github +++ b/Jenkinsfile.github @@ -25,6 +25,11 @@ */ @Library('csm-shared-library') _ +/* TODO: + While we use pyinstaller and build for noos, continue using 3.10 or older in order for canu to work on RPM-based + distros with older glibc. +*/ +def pythonVersion = '3.10' def pythonImage = 'artifactory.algol60.net/csm-docker/stable/csm-docker-sle-python' // Disable pr-merge builds; not used. @@ -59,6 +64,7 @@ pipeline { NAME = getRepoName() VERSION = '' PRIMARY_NODE = "${env.NODE_NAME}" + PYTHON_VERSION = "${pythonVersion}" } stages { @@ -70,21 +76,17 @@ pipeline { name 'ARCH' values 'x86_64' } - axis { - name 'PYTHON_VERSION' - values '3.10', '3.9' - } } environment { DOCKER_ARCH = sh(returnStdout: true, script: "[ ${ARCH} == 'x86_64' ] && echo -n 'amd64' || echo -n 'arm64'") - BUILD_DIR = "${env.WORKSPACE}/dist/rpmbuild/${ARCH}/${PYTHON_VERSION}" + BUILD_DIR = "${env.WORKSPACE}/dist/rpmbuild/${ARCH}/${pythonVersion}" } stages { stage('Build: setup') { steps { lock('docker-image-pull') { - sh "docker pull --platform linux/${DOCKER_ARCH} ${pythonImage}:${PYTHON_VERSION}" - sh "docker tag ${pythonImage}:${PYTHON_VERSION} ${pythonImage}:${PYTHON_VERSION}-${DOCKER_ARCH}" + sh "docker pull --platform linux/${DOCKER_ARCH} ${pythonImage}:${pythonVersion}" + sh "docker tag ${pythonImage}:${pythonVersion} ${pythonImage}:${pythonVersionN}-${DOCKER_ARCH}" } } } @@ -94,7 +96,7 @@ pipeline { label "${PRIMARY_NODE}" reuseNode true args "-v /home/jenkins/.ssh:/home/jenkins/.ssh --platform linux/${DOCKER_ARCH}" - image "${pythonImage}:${PYTHON_VERSION}-${DOCKER_ARCH}" + image "${pythonImage}:${pythonVersion}-${DOCKER_ARCH}" } } steps { @@ -121,7 +123,7 @@ pipeline { label "${PRIMARY_NODE}" reuseNode true args "-v /home/jenkins/.ssh:/home/jenkins/.ssh --platform linux/${DOCKER_ARCH}" - image "${pythonImage}:${PYTHON_VERSION}-${DOCKER_ARCH}" + image "${pythonImage}:${pythonVersion}-${DOCKER_ARCH}" } } steps { @@ -137,7 +139,7 @@ pipeline { label "${PRIMARY_NODE}" reuseNode true args "-v /home/jenkins/.ssh:/home/jenkins/.ssh --platform linux/${DOCKER_ARCH}" - image "${pythonImage}:${PYTHON_VERSION}-${DOCKER_ARCH}" + image "${pythonImage}:${pythonVersion}-${DOCKER_ARCH}" } } steps { @@ -147,14 +149,14 @@ pipeline { component: env.NAME, isStable: isStable, os: "noos", - pattern: "dist/rpmbuild/${ARCH}/${PYTHON_VERSION}/RPMS/${ARCH}/*.rpm", + pattern: "dist/rpmbuild/${ARCH}/${pythonVersion}/RPMS/${ARCH}/*.rpm", ) publishCsmRpms( arch: "src", component: env.NAME, isStable: isStable, os: "noos", - pattern: "dist/rpmbuild/${ARCH}/${PYTHON_VERSION}/SRPMS/*.rpm", + pattern: "dist/rpmbuild/${ARCH}/${pythonVersion}/SRPMS/*.rpm", ) } } diff --git a/Makefile b/Makefile index a4ef4d2bf..9739534ce 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ export ARCH := x86_64 endif ifeq ($(PYTHON_VERSION),) -export PYTHON_VERSION := 3.10 +export PYTHON_VERSION := 3.12 endif export PYTHON_BIN := python$(PYTHON_VERSION) diff --git a/pyproject.toml b/pyproject.toml index 4bd2b836b..bba83f999 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,6 +35,8 @@ classifiers = [ 'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', ] description = 'CSM Automatic Network Utility' dependencies = [