From c54bc14563ff11e5f3abe6a3d4cd27fa1bffeb2c Mon Sep 17 00:00:00 2001 From: Brad Keryan Date: Tue, 28 Jan 2025 16:27:07 -0600 Subject: [PATCH 1/4] GitHub: Use Python 3.11.9 by default --- .github/workflows/Publish_NIMS.yml | 16 ++++++++-------- .github/workflows/check_examples.yml | 2 +- .github/workflows/check_nimg.yml | 2 +- .github/workflows/check_nims.yml | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/Publish_NIMS.yml b/.github/workflows/Publish_NIMS.yml index 200272986..920140415 100644 --- a/.github/workflows/Publish_NIMS.yml +++ b/.github/workflows/Publish_NIMS.yml @@ -10,7 +10,7 @@ concurrency: publish_to_pypi env: # Versions are also listed in PR.yml POETRY_VERSION: 1.8.2 - PYTHON_VERSION: 3.9 + PYTHON_VERSION: 3.11.9 jobs: check_nims: @@ -22,7 +22,7 @@ jobs: # package version that doesn't exist yet. build: name: Build - runs-on : ubuntu-latest + runs-on : ubuntu-latest steps: - name: Check out repo uses: actions/checkout@v4 @@ -48,12 +48,12 @@ jobs: run: | poetry version ${{ steps.vars.outputs.tag }} working-directory: ./packages/service - + - name: Update NIMG package version based on tag name. run: | poetry version ${{ steps.vars.outputs.tag }} working-directory: ./packages/generator - + - name: Update SDK package version based on tag name. run: | poetry version ${{ steps.vars.outputs.tag }} @@ -71,13 +71,13 @@ jobs: git commit -m "Promote NIMS and NIMG package version" -a echo "version_changed=true" >> $GITHUB_OUTPUT fi - + - name: Push changes to the appropriate branch if: ${{ steps.commit.outputs.version_changed && (startsWith(github.event.release.target_commitish, 'main') || startsWith(github.event.release.target_commitish, 'releases/')) }} uses: CasperWA/push-protected@v2 with: token: ${{ secrets.ADMIN_PAT }} - branch: ${{ github.event.release.target_commitish }} + branch: ${{ github.event.release.target_commitish }} unprotect_reviews: true # To Test the Publish use : poetry publish --build --username __token__ --password ${{ secrets.TEST_PYPI_TOKEN }} -r test-pypi @@ -86,7 +86,7 @@ jobs: run: | poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }} working-directory: ./packages/service - + - name: Build NIMG Python package and publish to PyPI if: ${{ startsWith(github.event.release.target_commitish, 'main') || startsWith(github.event.release.target_commitish, 'releases/') }} run: | @@ -101,7 +101,7 @@ jobs: - name: Create archives of the examples env: - EXAMPLE_ARCHIVE: measurement-plugin-python-examples-${{ steps.vars.outputs.tag }} + EXAMPLE_ARCHIVE: measurement-plugin-python-examples-${{ steps.vars.outputs.tag }} run: | # Use --prefix for the tarball but not the zip file. Windows zip tools often create a directory automatically. rm -rf dist diff --git a/.github/workflows/check_examples.yml b/.github/workflows/check_examples.yml index 2ea2a2420..cb11b2490 100644 --- a/.github/workflows/check_examples.yml +++ b/.github/workflows/check_examples.yml @@ -6,7 +6,7 @@ on: env: POETRY_VERSION: 1.8.2 - PYTHON_VERSION: 3.9 + PYTHON_VERSION: 3.11.9 jobs: check_examples: diff --git a/.github/workflows/check_nimg.yml b/.github/workflows/check_nimg.yml index 8200b35c7..6fb193a4f 100644 --- a/.github/workflows/check_nimg.yml +++ b/.github/workflows/check_nimg.yml @@ -6,7 +6,7 @@ on: env: POETRY_VERSION: 1.8.2 - PYTHON_VERSION: 3.9 + PYTHON_VERSION: 3.11.9 jobs: check_nimg: diff --git a/.github/workflows/check_nims.yml b/.github/workflows/check_nims.yml index a89b23591..9b7ea1328 100644 --- a/.github/workflows/check_nims.yml +++ b/.github/workflows/check_nims.yml @@ -6,7 +6,7 @@ on: env: POETRY_VERSION: 1.8.2 - PYTHON_VERSION: 3.9 + PYTHON_VERSION: 3.11.9 jobs: check_nims: From 3283311838ca66289aa5e048b534bbc4eb91ece1 Mon Sep 17 00:00:00 2001 From: Brad Keryan Date: Tue, 28 Jan 2025 16:27:37 -0600 Subject: [PATCH 2/4] GitHub: Run tests with Python 3.13 --- .github/workflows/run_unit_tests.yml | 2 +- packages/generator/tox.ini | 2 +- packages/service/tox.ini | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml index 2298b9528..ac133de63 100644 --- a/.github/workflows/run_unit_tests.yml +++ b/.github/workflows/run_unit_tests.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-latest] - python-version: [3.8, 3.9, '3.10', 3.11, 3.12] + python-version: [3.8, 3.9, '3.10', 3.11, 3.12, 3.13] # Fail-fast skews the pass/fail ratio and seems to make pytest produce # incomplete JUnit XML results. fail-fast: false diff --git a/packages/generator/tox.ini b/packages/generator/tox.ini index baf2b88af..b04a8cde0 100644 --- a/packages/generator/tox.ini +++ b/packages/generator/tox.ini @@ -5,7 +5,7 @@ [tox] isolated_build = true -envlist = clean, py{38,39,310,311,312} +envlist = clean, py{38,39,310,311,312,313} [testenv] skip_install = true diff --git a/packages/service/tox.ini b/packages/service/tox.ini index b31600d58..6892fbb75 100644 --- a/packages/service/tox.ini +++ b/packages/service/tox.ini @@ -5,7 +5,7 @@ [tox] isolated_build = true -envlist = clean, py{38,39,310,311,312}-all-extras +envlist = clean, py{38,39,310,311,312,313}-all-extras [testenv] skip_install = true From e26d426da5afd1e0244ba2b94455afbc44a6d3de Mon Sep 17 00:00:00 2001 From: Brad Keryan Date: Tue, 28 Jan 2025 16:32:25 -0600 Subject: [PATCH 3/4] RTD: Update to Python 3.11 and latest Ubuntu --- .readthedocs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 2b821b65e..abf5b7e92 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,9 +1,9 @@ version: 2 build: - os: ubuntu-22.04 + os: ubuntu-24.04 tools: - python: "3.9" + python: "3.11" jobs: post_create_environment: - pip install poetry==1.8.2 From d22410c1ec4b9c1efaaaf0472bac9c5e22b6ec1d Mon Sep 17 00:00:00 2001 From: Brad Keryan Date: Tue, 28 Jan 2025 17:00:58 -0600 Subject: [PATCH 4/4] service: Update dependencies for Python 3.13 --- packages/service/pyproject.toml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/service/pyproject.toml b/packages/service/pyproject.toml index 5e664c77e..34b9edb0c 100644 --- a/packages/service/pyproject.toml +++ b/packages/service/pyproject.toml @@ -31,7 +31,7 @@ python = "^3.8" # below. Please keep the minimum grpcio version in sync with the grpcio-tools version. Otherwise, # the generated gRPC stubs may not work with the minimum grpcio version. grpcio = "^1.49.1" -protobuf = "^4.21" +protobuf = ">=4.21" pywin32 = {version = ">=303", platform = "win32"} deprecation = ">=2.1" # https://github.com/microsoft/tracelogging/issues/58 - traceloggingdynamic raises TypeError with Python 3.8 @@ -62,14 +62,15 @@ ni-python-styleguide = ">=0.4.1" # and regenerate gRPC stubs. grpcio-tools = [ {version = "1.49.1", python = ">=3.8,<3.12"}, - {version = "1.59.0", python = "^3.12"}, + {version = "1.59.0", python = ">=3.12,<3.13"}, + {version = "1.67.0", python = "^3.13"}, ] pytest-cov = ">=3.0.0" pytest-mock = ">=3.0" tox = ">=4.0" mypy = ">=1.0" mypy-protobuf = ">=3.4" -types-protobuf = "^4.21" +types-protobuf = ">=4.21" types-setuptools = "*" types-pywin32 = ">=304" grpc-stubs = "^1.53" @@ -79,7 +80,7 @@ types-psutil = ">=6.0" # we need to include multiple NumPy versions in poetry.lock. numpy = [ {version = ">=1.22", python = ">=3.8,<3.12"}, - {version = ">=1.26", python = ">=3.12,<3.13"}, + {version = ">=1.26", python = "^3.12"}, ] bandit = { version = ">=1.7", extras = ["toml"] } @@ -89,7 +90,7 @@ optional = true [tool.poetry.group.docs.dependencies] Sphinx = [ {version = ">=7.1.2", python = ">=3.8,<3.9"}, - {version = ">=7.2.0", python = ">=3.9,<3.13"}, + {version = ">=7.2.0", python = "^3.9"}, ] sphinx-rtd-theme = ">=1.0.0" sphinx-autoapi = ">=1.8.4"