From 265cbb9850bcb8265cc30e28f305418638146359 Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Sun, 29 Sep 2024 23:07:37 +0200 Subject: [PATCH] ci: update to py39 --- .github/workflows/workflow.yml | 88 +++++++++++++++++----------------- pyproject.toml | 2 +- 2 files changed, 44 insertions(+), 46 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index a5cd1d2..81912ae 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -9,102 +9,100 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: 3.7.12 # Patch version must be specified to avoid any cache confusion, since the cache key depends on the full Python version. Any potentiel difference in patches between jobs will lead to a cache not found error. + python-version: 3.9.13 # Patch version must be specified to avoid any cache confusion, since the cache key depends on the full Python version. Any potentiel difference in patches between jobs will lead to a cache not found error. - name: Cache build id: restore-build - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ env.pythonLocation }} - key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} # Cache the entire build Python environment + key: build-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} # Cache the entire build Python environment restore-keys: | - build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} + build-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }} build-${{ env.pythonLocation }}- - name: Build package run: make build - name: Cache release id: restore-release - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: dist - key: release-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} + key: release-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} lint-files: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: [ build ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Fetch all the tags - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: 3.7.12 + python-version: 3.9.13 - name: Cache build id: restore-build - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ env.pythonLocation }} - key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} + key: build-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} - run: make check-syntax-errors - run: make check-style - - name: Lint Python files - run: "${GITHUB_WORKSPACE}/.github/lint-changed-python-files.sh" - name: Lint YAML tests run: "${GITHUB_WORKSPACE}/.github/lint-changed-yaml-tests.sh" test-yaml: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: [ build ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: 3.7.12 + python-version: 3.9.13 - name: Cache build id: restore-build - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ env.pythonLocation }} - key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} + key: build-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} - run: openfisca test openfisca_extension_template/tests --country-package openfisca_country_template --extensions openfisca_extension_template test-api: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: [ build ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: 3.7.12 + python-version: 3.9.13 - name: Cache build id: restore-build - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ env.pythonLocation }} - key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} + key: build-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} - name: Test the Web API run: "${GITHUB_WORKSPACE}/.github/test-api.sh" check-version-and-changelog: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: [ lint-files, test-yaml, test-api ] # Last job to run steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Fetch all the tags - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: 3.7.12 + python-version: 3.9.13 - name: Check version number has been properly updated run: "${GITHUB_WORKSPACE}/.github/is-version-number-acceptable.sh" @@ -112,46 +110,46 @@ jobs: # We build a separate job to substitute the halt option. # The `deploy` job is dependent on the output of the `check-for-functional-changes`job. check-for-functional-changes: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 if: github.ref == 'refs/heads/master' # Only triggered for the `master` branch needs: [ check-version-and-changelog ] outputs: status: ${{ steps.stop-early.outputs.status }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Fetch all the tags - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: 3.7.12 + python-version: 3.9.13 - id: stop-early run: if "${GITHUB_WORKSPACE}/.github/has-functional-changes.sh" ; then echo "::set-output name=status::success" ; fi deploy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: [ check-for-functional-changes ] if: needs.check-for-functional-changes.outputs.status == 'success' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Fetch all the tags - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: 3.7.12 + python-version: 3.9.13 - name: Cache build id: restore-build - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ env.pythonLocation }} - key: build-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} + key: build-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} - name: Cache release id: restore-release - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: dist - key: release-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ github.sha }} + key: release-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ github.sha }} - name: Upload a Python package to PyPi run: twine upload dist/* --username __token__ --password ${{ secrets.PYPI_TOKEN_OPENFISCA_BOT }} - name: Publish a git tag diff --git a/pyproject.toml b/pyproject.toml index f182f85..4b5e9dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,7 +84,7 @@ docstring-code-format = true docstring-code-line-length = 72 [tool.ruff.lint] -ignore = ["COM812", "D101", "ISC001", "N801", "N805"] +ignore = ["COM812", "D101", "D104", "ISC001", "N801", "N805"] select = ["ALL"] [tool.ruff.lint.pydocstyle]