From e9202e47106e3281c50fd7f8452e6302bd0a4cb0 Mon Sep 17 00:00:00 2001 From: Lucas PASCAL Date: Mon, 5 Feb 2024 14:46:40 +0100 Subject: [PATCH 1/3] [ci][add] Testing package on Python version 3.8 -> 3.11 --- .github/workflows/build_and_tests.yml | 5 ++++- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_tests.yml b/.github/workflows/build_and_tests.yml index 54ac976..e711c64 100644 --- a/.github/workflows/build_and_tests.yml +++ b/.github/workflows/build_and_tests.yml @@ -15,14 +15,17 @@ on: paths: - src - tests + - .github/workflows/build_and_tests.yml jobs: build_install_test: name: Build, install and test the Ledgered Python package runs-on: ubuntu-latest + strategy: + matrix: + python_version: ['3.8', '3.9', '3.10', '3.11'] steps: - - name: Clone uses: actions/checkout@v3 diff --git a/pyproject.toml b/pyproject.toml index c105a4a..e83f047 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,10 +16,10 @@ readme = { file = "README.md", content-type = "text/markdown" } license = { file = "LICENSE" } classifiers = [ "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Operating System :: POSIX :: Linux", "Operating System :: Microsoft :: Windows", "Operating System :: MacOS :: MacOS X", From fc7df64032c9a05a6784a39e3861c561b2cfb1ac Mon Sep 17 00:00:00 2001 From: Lucas PASCAL Date: Mon, 5 Feb 2024 14:49:52 +0100 Subject: [PATCH 2/3] [ci][clean] Removing test.pypi.org deployments --- .github/workflows/build_and_tests.yml | 34 +++++++-------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build_and_tests.yml b/.github/workflows/build_and_tests.yml index e711c64..846ad03 100644 --- a/.github/workflows/build_and_tests.yml +++ b/.github/workflows/build_and_tests.yml @@ -54,30 +54,22 @@ jobs: with: fetch-depth: 0 - # Fetching dependencies from test.pypi,org or pypi.org depending on the package destination: - # tag -> pypi.org, not tag -> test.pypi.org - name: Build Ledgered Python package run: | pip install --upgrade pip build twine - if [[ ${{ github.ref }} == "refs/tags/"* ]]; \ - then \ - python -m build; \ - pip install . - else \ - PIP_EXTRA_INDEX_URL=https://test.pypi.org/simple/ python -m build; \ - pip install --extra-index-url https://test.pypi.org/simple/ . - fi + python -m build; \ + pip install . python -m twine check dist/* echo "TAG_VERSION=$(python -c 'from ledgered import __version__; print(__version__)')" >> "$GITHUB_ENV" - name: Display current status run: | echo "Current status is:" - if [[ ${{ github.ref }} == "refs/tags/"* ]]; \ - then \ - echo "- Triggered from tag, will be deployed on pypi.org"; \ - else \ - echo "- Not triggered from tag, will be deployed on test.pypi.org"; \ + if [[ ${{ github.ref }} == "refs/tags/"* ]]; + then + echo "- Triggered from tag, package will be a release"; + else + echo "- Not triggered from tag, package will be a pre-release"; fi echo "- Tag version: ${{ env.TAG_VERSION }}" @@ -94,7 +86,7 @@ jobs: fi - name: Publish Python package on pypi.org - if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + if: success() && github.event_name == 'push' run: python -m twine upload dist/* env: TWINE_USERNAME: __token__ @@ -107,15 +99,7 @@ jobs: with: automatic_release_tag: "v${{ env.TAG_VERSION }}" repo_token: "${{ secrets.GITHUB_TOKEN }}" - prerelease: true + prerelease: false files: | LICENSE dist/ - - - name: Publish Python package on test.pypi.org - if: success() && github.event_name == 'push' - run: python -m twine upload --repository testpypi dist/* - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PUBLIC_API_TOKEN }} - TWINE_NON_INTERACTIVE: 1 From 0db9fd2bd65a6e7fce5314a970bd5d81fe7d9f47 Mon Sep 17 00:00:00 2001 From: Lucas PASCAL Date: Mon, 5 Feb 2024 14:52:08 +0100 Subject: [PATCH 3/3] [ci][clean] Updating actions/checkout version from 3 to 4 --- .github/workflows/build_and_tests.yml | 4 ++-- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/fast-checks.yml | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_and_tests.yml b/.github/workflows/build_and_tests.yml index 846ad03..a4caa7b 100644 --- a/.github/workflows/build_and_tests.yml +++ b/.github/workflows/build_and_tests.yml @@ -27,7 +27,7 @@ jobs: python_version: ['3.8', '3.9', '3.10', '3.11'] steps: - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build & install run: | @@ -50,7 +50,7 @@ jobs: steps: - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a8ebca8..351a896 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -30,7 +30,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/fast-checks.yml b/.github/workflows/fast-checks.yml index 79b41c2..b3024f4 100644 --- a/.github/workflows/fast-checks.yml +++ b/.github/workflows/fast-checks.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 - run: pip install flake8 - name: Flake8 lint Python code run: find src/ -type f -name '*.py' -exec flake8 --max-line-length=120 '{}' '+' @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 - run: pip install yapf toml - name: Yapf source formatting run: | @@ -35,7 +35,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 - run: pip install mypy types-toml - name: Mypy type checking run: mypy src @@ -45,7 +45,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 - run: pip install bandit - name: Bandit security checking run: bandit -r src -ll @@ -55,7 +55,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check misspellings uses: codespell-project/actions-codespell@v1 with: