From 4a15eaaf31352be22c377c66d5045caa26d7a7f2 Mon Sep 17 00:00:00 2001 From: Alex Tomkins Date: Sun, 29 Jun 2025 11:41:27 +0100 Subject: [PATCH 1/6] Minor package upgrades --- requirements/local.txt | 4 ++-- requirements/testing.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements/local.txt b/requirements/local.txt index eaaae2c..21b6f4a 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -3,5 +3,5 @@ bump-my-version==1.2.0 Django>=5.2,<6.0 psycopg==3.2.9 -tox==4.26.0 -tox-uv==1.26.0 +tox==4.27.0 +tox-uv==1.26.1 diff --git a/requirements/testing.txt b/requirements/testing.txt index de608ef..fbdf1d9 100644 --- a/requirements/testing.txt +++ b/requirements/testing.txt @@ -2,5 +2,5 @@ build==1.2.2.post1 check-wheel-contents==0.6.1 coverage==7.9.1 pipdeptree==2.26.1 -ruff==0.11.13 +ruff==0.12.1 twine==6.1.0 From af4f644633a30afbce75ce98793d7b58609bf47b Mon Sep 17 00:00:00 2001 From: Alex Tomkins Date: Sun, 29 Jun 2025 11:42:22 +0100 Subject: [PATCH 2/6] Drop coverage XML --- .gitignore | 1 - Makefile | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 8406517..5ca1562 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,4 @@ build .tox/ .coverage .coverage.* -coverage.xml htmlcov/ diff --git a/Makefile b/Makefile index e905ddf..5ee1224 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,7 @@ pip-install-local: venv-check # Coverage -coverage-report: coverage-combine coverage-html coverage-xml +coverage-report: coverage-combine coverage-html coverage report --show-missing coverage-combine: @@ -101,12 +101,8 @@ coverage-combine: coverage-html: coverage html -coverage-xml: - coverage xml - coverage-clean: rm -rf htmlcov - rm -f coverage.xml rm -f .coverage From c4d965e9cc8bbb1963bc77385c9670f6a465a22d Mon Sep 17 00:00:00 2001 From: Alex Tomkins Date: Sun, 29 Jun 2025 11:43:02 +0100 Subject: [PATCH 3/6] Add TOML/YAML to editorconfig --- .editorconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.editorconfig b/.editorconfig index 38ecdde..ea38bae 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,6 +14,10 @@ charset = utf-8 [*.py] max_line_length = 99 +# Smaller indent for TOML/YAML +[*.{toml,yaml,yml}] +indent_size = 2 + # Use 2 spaces for the HTML files [*.html] indent_size = 2 From 78521e2c065a809d954ba3a2a27a4182d1555470 Mon Sep 17 00:00:00 2001 From: Alex Tomkins Date: Sun, 29 Jun 2025 11:44:32 +0100 Subject: [PATCH 4/6] gitignore consistency --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5ca1562..49d6a6a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ MANIFEST dist build *.egg-info +.*_cache # Tox .tox/ From 4aa733d4479b2fe2dc6696da1b84064e81c12c92 Mon Sep 17 00:00:00 2001 From: Alex Tomkins Date: Sun, 29 Jun 2025 11:48:45 +0100 Subject: [PATCH 5/6] Add coverage to CI --- .github/workflows/ci.yml | 44 +++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index acd714a..3ca50ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,9 +16,9 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.13' - cache: 'pip' - cache-dependency-path: 'requirements/*.txt' + python-version: "3.13" + cache: "pip" + cache-dependency-path: "requirements/*.txt" - name: Run tox id: matrix run: | @@ -45,8 +45,8 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - cache: 'pip' - cache-dependency-path: 'requirements/*.txt' + cache: "pip" + cache-dependency-path: "requirements/*.txt" - name: Run tests env: PGHOST: localhost @@ -57,6 +57,13 @@ jobs: run: | pip install $(grep -E "^(tox|tox-uv)==" requirements/local.txt) tox -e ${{ matrix.tox_env }} + - name: Upload coverage data + uses: actions/upload-artifact@v4 + with: + name: coverage-data-${{ matrix.tox_env }} + include-hidden-files: true + path: .coverage.* + if-no-files-found: ignore services: postgres: image: postgres:17-alpine @@ -65,3 +72,30 @@ jobs: ports: - 5432:5432 options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + + coverage: + name: Coverage + runs-on: ubuntu-24.04 + needs: test + if: always() + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + persist-credentials: false + ref: ${{ github.event.pull_request.head.sha }} + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.13" + cache: "pip" + cache-dependency-path: "requirements/*.txt" + - uses: actions/download-artifact@v4 + with: + pattern: coverage-data-* + merge-multiple: true + - name: Run coverage + run: | + pip install $(grep -E "^(tox|tox-uv)==" requirements/local.txt) + tox -e coverage + tox -qq exec -e coverage -- coverage report --format=markdown >> $GITHUB_STEP_SUMMARY From 355602fe31da17f0aba21ea6274666d90f318968 Mon Sep 17 00:00:00 2001 From: Alex Tomkins Date: Sun, 29 Jun 2025 12:01:22 +0100 Subject: [PATCH 6/6] Don't add version to __init__.py --- postgres_lock/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/postgres_lock/__init__.py b/postgres_lock/__init__.py index 485f44a..e69de29 100644 --- a/postgres_lock/__init__.py +++ b/postgres_lock/__init__.py @@ -1 +0,0 @@ -__version__ = "0.1.1"