From e5f9148958f9b168d2e258f11eaf7d72678d4772 Mon Sep 17 00:00:00 2001 From: Muhammad Furqan Habibi Date: Thu, 6 Jun 2024 19:43:17 +0900 Subject: [PATCH 1/7] Support python 3.12, update lxml to 5.x --- .github/workflows/workflow.yml | 46 +++++++++++++++++----------------- pyproject.toml | 4 ++- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index ee6cf60..4e295e8 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -6,16 +6,16 @@ jobs: lock: strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - run: curl -sSL https://install.python-poetry.org | python3 - - run: poetry lock - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: path: poetry.lock key: ${{ github.sha }}-${{ matrix.python-version }} @@ -23,14 +23,14 @@ jobs: needs: lock strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: path: poetry.lock key: ${{ github.sha }}-${{ matrix.python-version }} @@ -41,14 +41,14 @@ jobs: needs: lock strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: path: poetry.lock key: ${{ github.sha }}-${{ matrix.python-version }} @@ -59,14 +59,14 @@ jobs: needs: lock runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: - python-version: "3.10" - - uses: actions/cache@v2 + python-version: "3.12" + - uses: actions/cache@v4 with: path: poetry.lock - key: ${{ github.sha }}-3.10 + key: ${{ github.sha }}-3.12 - run: curl -sSL https://install.python-poetry.org | python3 - - run: poetry install - run: poetry run isort --check --diff src tests @@ -74,14 +74,14 @@ jobs: needs: lock runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: - python-version: "3.10" - - uses: actions/cache@v2 + python-version: "3.12" + - uses: actions/cache@v4 with: path: poetry.lock - key: ${{ github.sha }}-3.10 + key: ${{ github.sha }}-3.12 - run: curl -sSL https://install.python-poetry.org | python3 - - run: poetry install - - run: poetry run black --check src/ tests/ \ No newline at end of file + - run: poetry run black --check src/ tests/ diff --git a/pyproject.toml b/pyproject.toml index e54fab0..c3fbc22 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,8 @@ classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.8", @@ -23,7 +25,7 @@ classifiers = [ [tool.poetry.dependencies] python = "^3.7" minisignxml = ">=22.4" -lxml = "^4.9" +lxml = "^5.2" yarl = ">=1.4.2" # poetry doesn't support extras in dev-dependencies, so these must be here as optional dependencies Sphinx = { version = "^5", optional = true } From c80a1ea3d846c7f8d15a3dbac1412055c82c675d Mon Sep 17 00:00:00 2001 From: Muhammad Furqan Habibi Date: Thu, 6 Jun 2024 19:49:29 +0900 Subject: [PATCH 2/7] Remove python 3.7 support --- .github/workflows/workflow.yml | 6 +++--- pyproject.toml | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4e295e8..c5ee039 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -6,7 +6,7 @@ jobs: lock: strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v4 @@ -23,7 +23,7 @@ jobs: needs: lock strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v4 @@ -41,7 +41,7 @@ jobs: needs: lock strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v4 diff --git a/pyproject.toml b/pyproject.toml index c3fbc22..bfedf24 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,6 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Typing :: Typed" ] From ded00caf77d7e021ef0da5da3d672be22a428389 Mon Sep 17 00:00:00 2001 From: Muhammad Furqan Habibi Date: Fri, 7 Jun 2024 09:20:15 +0900 Subject: [PATCH 3/7] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bfedf24..f71a7c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ classifiers = [ ] [tool.poetry.dependencies] -python = "^3.7" +python = "^3.8" minisignxml = ">=22.4" lxml = "^5.2" yarl = ">=1.4.2" From 5b19df6d74233f2cfdaf580a1380e71ef7ba09a3 Mon Sep 17 00:00:00 2001 From: Muhammad Furqan Habibi Date: Fri, 7 Jun 2024 17:07:04 +0900 Subject: [PATCH 4/7] Create release.yml --- .github/workflows/release.yml | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d93d945 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: minisaml release workflow + +on: + release: + types: [released] # only triggered on release, not pre-release or draft release + +permissions: + contents: read + id-token: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + +env: + PYTHON_VERSION: 3.12 + TARGET_BRANCH: ${{ github.event.release.target_commitish }} + DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} + TAG_NAME: ${{ github.ref_name }} + +jobs: + release: + name: Release to PyPI + runs-on: ubuntu-latest + steps: + - name: Check whether release target branch is default branch + if: env.TARGET_BRANCH != env.DEFAULT_BRANCH + uses: actions/github-script@v7 + with: + script: | + core.setFailed('Target branch (${{ env.TARGET_BRANCH }}) is not default branch (${{ env.DEFAULT_BRANCH }}).') + + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - run: curl -sSL https://install.python-poetry.org | python3 - + + - run: echo "PKG_VER=$(poetry version --short)" >> $GITHUB_ENV + + - name: Check whether current tag matches package version + if: env.TAG_NAME != env.PKG_VER + uses: actions/github-script@v7 + with: + script: | + core.setFailed('Tag name (${{ env.TAG_NAME }}) does not match package version (${{ env.PKG_VER }}).') + + - name: Build package + run: poetry build + + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 From f765759dd2c8d84b97eb2a4b3096aa518305ef06 Mon Sep 17 00:00:00 2001 From: Muhammad Furqan Habibi Date: Fri, 7 Jun 2024 18:37:39 +0900 Subject: [PATCH 5/7] Update workflow.yml --- .github/workflows/workflow.yml | 40 +++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index c5ee039..3367b96 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -2,11 +2,37 @@ name: workflow on: [push, pull_request] +permissions: + actions: write + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + +env: + PYTHON_VERSIONS: '["3.8", "3.9", "3.10", "3.11", "3.12"]' + POETRY_VERSION: 1.8.3 + jobs: + # workaround since matrix can not access `env` but can access `needs` + python-versions: + runs-on: "ubuntu-latest" + outputs: + versions: ${{ steps.set-versions.outputs.versions }} + steps: + - id: set-versions + run: echo "versions=$PYTHON_VERSIONS" >> $GITHUB_OUTPUT + lock: + needs: python-versions strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ${{ fromJSON(needs.python-versions.outputs.versions) }} runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v4 @@ -19,11 +45,12 @@ jobs: with: path: poetry.lock key: ${{ github.sha }}-${{ matrix.python-version }} + pytest: - needs: lock + needs: [lock, python-versions] strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ${{ fromJSON(needs.python-versions.outputs.versions) }} runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v4 @@ -37,11 +64,12 @@ jobs: - run: curl -sSL https://install.python-poetry.org | python3 - - run: poetry install - run: poetry run pytest --verbose + mypy: - needs: lock + needs: [lock, python-versions] strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ${{ fromJSON(needs.python-versions.outputs.versions) }} runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v4 @@ -55,6 +83,7 @@ jobs: - run: curl -sSL https://install.python-poetry.org | python3 - - run: poetry install - run: poetry run mypy + isort: needs: lock runs-on: "ubuntu-latest" @@ -70,6 +99,7 @@ jobs: - run: curl -sSL https://install.python-poetry.org | python3 - - run: poetry install - run: poetry run isort --check --diff src tests + black: needs: lock runs-on: "ubuntu-latest" From c21b4136c6c349dcab8e383db5d8df39ef9474ce Mon Sep 17 00:00:00 2001 From: Muhammad Furqan Habibi Date: Mon, 10 Jun 2024 11:29:49 +0900 Subject: [PATCH 6/7] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f71a7c9..294d5b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ [tool.poetry.dependencies] python = "^3.8" minisignxml = ">=22.4" -lxml = "^5.2" +lxml = "^5.0" yarl = ">=1.4.2" # poetry doesn't support extras in dev-dependencies, so these must be here as optional dependencies Sphinx = { version = "^5", optional = true } From acaca32a391994f6afc50ec8ea584d021dfc58ed Mon Sep 17 00:00:00 2001 From: Muhammad Furqan Habibi Date: Mon, 10 Jun 2024 16:41:20 +0900 Subject: [PATCH 7/7] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 294d5b8..b8cac41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ classifiers = [ [tool.poetry.dependencies] python = "^3.8" -minisignxml = ">=22.4" +minisignxml = ">=24.6" lxml = "^5.0" yarl = ">=1.4.2" # poetry doesn't support extras in dev-dependencies, so these must be here as optional dependencies