Skip to content

Commit

Permalink
Support Python 3.11 and 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
rustydb committed Nov 5, 2024
1 parent 4c8d0a1 commit 2a5c6d9
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/promote-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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#*/}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
26 changes: 14 additions & 12 deletions Jenkinsfile.github
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -59,6 +64,7 @@ pipeline {
NAME = getRepoName()
VERSION = ''
PRIMARY_NODE = "${env.NODE_NAME}"
PYTHON_VERSION = "${pythonVersion}"
}

stages {
Expand All @@ -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}"
}
}
}
Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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",
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit 2a5c6d9

Please sign in to comment.