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 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 diff --git a/.gitignore b/.gitignore index 8406517..49d6a6a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,10 +3,10 @@ MANIFEST dist build *.egg-info +.*_cache # Tox .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 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" 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