Skip to content

Tidying and coverage #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 39 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ MANIFEST
dist
build
*.egg-info
.*_cache

# Tox
.tox/
.coverage
.coverage.*
coverage.xml
htmlcov/
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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


Expand Down
1 change: 0 additions & 1 deletion postgres_lock/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
__version__ = "0.1.1"
4 changes: 2 additions & 2 deletions requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion requirements/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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