Skip to content

Commit 18e11c4

Browse files
committed
Merge branch 'release/1.6'
* release/1.6: testt packahe wheel minor improvements to tox.ini minor improvements to tox.ini add tox task to test package just a bit of coverage updates tox and CI fixes deps updates docs CI fixes wrong deps updates tox updates CI and tox updated docs and CI new pyproject.toml bump version open 1.6rc bump version remove testcommand
2 parents 37434e4 + 718f584 commit 18e11c4

31 files changed

+622
-322
lines changed

.bumpversion.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
[bumpversion]
2-
current_version = 1.5.8
2+
current_version = 1.6.0
33
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
44
serialize = {major}.{minor}.{patch}
55
commit = False
66
tag = False
77
allow_dirty = True
88

99
[bumpversion:file:src/admin_extra_buttons/__init__.py]
10+
11+
[bumpversion:file:pyproject.toml]

.github/file-filters.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This is used by the action https://github.com/dorny/paths-filter
2+
dependencies: &dependencies
3+
- 'pyproject.toml'
4+
5+
python: &python
6+
- added|modified: 'src/**'
7+
- added|modified: 'tests/**'
8+
- 'manage.py'
9+
10+
changelog:
11+
- added|modified: 'changes/**'
12+
- 'CHANGELOG.md'
13+
14+
mypy:
15+
- *python
16+
- 'mypy.ini'
17+
18+
run_tests:
19+
- *python
20+
- *dependencies
21+
- 'pytest.ini'
22+
- '.github/workflows/test.yml'
23+
- '.github/file-filters.yml'
24+
25+
lint:
26+
- *python
27+
- '.flake8'
28+
- 'pyproject.toml'
29+
- '.github/file-filters.yml'
30+
- '.github/workflows/lint.yml'

.github/workflows/docs.yml

Lines changed: 64 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,67 @@
1-
name: Documentation
1+
name: "Documentation"
2+
23
on:
3-
push:
4-
paths:
5-
- 'docs/**'
6-
- 'README.md'
7-
- '.github/workflows/docs.yml'
4+
push:
5+
branches:
6+
- develop
7+
- master
8+
schedule:
9+
- cron: '37 23 * * 2'
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
819

920
jobs:
10-
build:
11-
name: Deploy docs
12-
runs-on: ubuntu-latest
13-
steps:
14-
- name: Checkout main
15-
uses: actions/checkout@v2
16-
17-
- name: Deploy docs
18-
uses: mhausenblas/mkdocs-deploy-gh-pages@master
19-
# Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme
20-
env:
21-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22-
# CUSTOM_DOMAIN: optionaldomain.com
23-
CONFIG_FILE: ./mkdocs.yml
24-
EXTRA_PACKAGES: build-base
25-
# GITHUB_DOMAIN: github.myenterprise.com
26-
REQUIREMENTS: docs/requirements.txt
21+
generate:
22+
name: Generate
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Restore cached venv
28+
id: cache-venv-restore
29+
uses: actions/cache/restore@v4
30+
with:
31+
path: |
32+
.cache-uv/
33+
.venv/
34+
key: ${{ matrix.python-version }}-${{matrix.django-version}}-venv
35+
36+
- uses: yezz123/setup-uv@v4
37+
- name: Build Doc
38+
run: |
39+
uv sync --extra docs
40+
PYTHONPATH=./src uv run --cache-dir .cache-uv/ mkdocs build -d ./docs-output
41+
42+
- name: Cache venv
43+
if: steps.cache-venv-restore.outputs.cache-hit != 'true'
44+
id: cache-venv-save
45+
uses: actions/cache/save@v4
46+
with:
47+
path: |
48+
.cache-uv/
49+
.venv/
50+
key: ${{ matrix.python-version }}-${{matrix.django-version}}-venv
51+
52+
- name: Upload artifact
53+
uses: actions/upload-pages-artifact@v3
54+
with:
55+
path: ./docs-output
56+
57+
# Deployment job
58+
deploy:
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
runs-on: ubuntu-latest
63+
needs: generate
64+
steps:
65+
- name: Deploy to GitHub Pages
66+
id: deployment
67+
uses: actions/deploy-pages@v4

.github/workflows/lint.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- '**' # matches every branch
7+
8+
concurrency:
9+
group: "${{ github.workflow }}-${{ github.ref }}-lint"
10+
cancel-in-progress: true
11+
12+
defaults:
13+
run:
14+
shell: bash
15+
16+
permissions:
17+
id-token: write
18+
attestations: write
19+
20+
21+
jobs:
22+
changes:
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 1
25+
defaults:
26+
run:
27+
shell: bash
28+
outputs:
29+
lint: ${{steps.changes.outputs.lint }}
30+
steps:
31+
- name: Checkout code
32+
uses: actions/[email protected]
33+
- id: changes
34+
name: Check for file changes
35+
uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
36+
with:
37+
base: ${{ github.ref }}
38+
token: ${{ github.token }}
39+
filters: .github/file-filters.yml
40+
41+
lint:
42+
runs-on: ubuntu-latest
43+
defaults:
44+
run:
45+
shell: bash
46+
needs: [ changes ]
47+
if: needs.changes.outputs.lint
48+
steps:
49+
- name: Checkout code
50+
uses: actions/[email protected]
51+
52+
- name: Set up Python
53+
uses: actions/setup-python@v5
54+
with:
55+
python-version: 3.12
56+
architecture: 'x64'
57+
- uses: yezz123/setup-uv@v4
58+
- name: lint
59+
if: needs.changes.outputs.lint
60+
run: |
61+
uv run isort src/ --check-only
62+
uv run flake8 src/

.github/workflows/test.yml

Lines changed: 109 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,114 @@
11
name: Test
22

33
on:
4-
push:
5-
branches:
6-
- master
7-
- develop
8-
pull_request:
4+
push:
5+
branches:
6+
- '**' # matches every branch
7+
8+
concurrency:
9+
group: "${{ github.workflow }}-${{ github.ref }}-test"
10+
cancel-in-progress: true
11+
12+
defaults:
13+
run:
14+
shell: bash
15+
16+
permissions:
17+
id-token: write
18+
attestations: write
19+
920

1021
jobs:
11-
lint:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-python@v2
16-
17-
- name: Install dependencies
18-
run: |
19-
python -m pip install --upgrade pip flake8 isort
20-
- name: Lint with flake8
21-
run: |
22-
flake8 src
23-
isort -c src
24-
25-
test:
26-
# if: ${{github.event}} && ${{ !contains(github.event.head_commit.message, 'ci skip') }}
27-
runs-on: ubuntu-latest
28-
strategy:
29-
fail-fast: false
30-
matrix:
31-
python-version: [ "3.11", "3.12"]
32-
django-version: [ "3.2", "4.2", "5.0"]
33-
env:
34-
PY_VER: ${{ matrix.python-version}}
35-
DJ_VER: ${{ matrix.django-version}}
36-
37-
steps:
38-
- uses: actions/checkout@v2
39-
40-
- name: Set up Python ${{ matrix.python-version }}
41-
uses: actions/setup-python@v2
42-
with:
43-
python-version: ${{ matrix.python-version }}
44-
45-
- name: Install dependencies
46-
run: python -m pip install tox
47-
48-
- name: Test with Tox
49-
run: tox -e d${DJ_VER//.}-py${PY_VER//.} -- --create-db --cov-report=xml --cov-report=term --junitxml=pytest.xml
50-
51-
- uses: codecov/codecov-action@v1
52-
with:
53-
# files: ./coverage1.xml,./coverage2.xml # optional
54-
# flags: unittests # optional
55-
# name: codecov-umbrella # optional
56-
# fail_ci_if_error: true # optional (default = false)
57-
verbose: true # optional (default = false)
22+
changes:
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 1
25+
defaults:
26+
run:
27+
shell: bash
28+
outputs:
29+
run_tests: ${{steps.changes.outputs.run_tests }}
30+
lint: ${{steps.changes.outputs.lint }}
31+
steps:
32+
- name: Checkout code
33+
uses: actions/[email protected]
34+
- id: changes
35+
name: Check for file changes
36+
uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
37+
with:
38+
base: ${{ github.ref }}
39+
token: ${{ github.token }}
40+
filters: .github/file-filters.yml
41+
42+
ci:
43+
runs-on: ubuntu-latest
44+
name: Test py${{ matrix.python-version }}/dj${{matrix.django-version}}
45+
defaults:
46+
run:
47+
shell: bash
48+
strategy:
49+
max-parallel: 1
50+
matrix:
51+
python-version: [ "3.11", "3.12" ]
52+
django-version: [ "4.2", "5.1" ]
53+
fail-fast: true
54+
needs: [ changes ]
55+
# if: needs.changes.outputs.run_tests || needs.changes.outputs.lint
56+
steps:
57+
- name: Checkout code
58+
uses: actions/[email protected]
59+
- name: Set up Python ${{ matrix.python-version }}
60+
uses: actions/setup-python@v5
61+
with:
62+
python-version: ${{ matrix.python-version }}
63+
architecture: 'x64'
64+
- name: Restore cached venv
65+
id: cache-venv-restore
66+
uses: actions/cache/restore@v4
67+
with:
68+
path: |
69+
.cache-uv/
70+
.venv/
71+
key: ${{ matrix.python-version }}-${{matrix.django-version}}-${{ hashFiles('pyproject.toml') }}-venv
72+
73+
- uses: yezz123/setup-uv@v4
74+
with:
75+
python: ${{ matrix.python-version }}
76+
77+
- name: Test
78+
# if: needs.changes.outputs.run_tests
79+
run: |
80+
uv export -q --no-hashes -o requirements.txt
81+
pip install -r requirements.txt
82+
pip install "django==${{ matrix.django-version }}.*"
83+
python -m pytest tests/ \
84+
--junit-xml junit-${{ matrix.python-version }}-${{matrix.django-version}}.xml \
85+
--cov --cov-report xml
86+
- name: Cache venv
87+
if: steps.cache-venv-restore.outputs.cache-hit != 'true'
88+
id: cache-venv-save
89+
uses: actions/cache/save@v4
90+
with:
91+
path: |
92+
.cache-uv/
93+
.venv/
94+
key: ${{ matrix.python-version }}-${{matrix.django-version}}-${{ hashFiles('pyproject.toml') }}-venv
95+
96+
- name: Upload pytest test results
97+
uses: actions/upload-artifact@v4
98+
with:
99+
name: pytest-results-${{ matrix.python-version }}-${{matrix.django-version}}
100+
path: junit-${{ matrix.python-version }}-${{matrix.django-version}}.xml
101+
if: ${{ always() }}
102+
103+
- name: Upload coverage to Codecov
104+
uses: codecov/codecov-action@v4
105+
if: matrix.python-version == 3.12
106+
continue-on-error: true
107+
with:
108+
env_vars: OS,PYTHON
109+
fail_ci_if_error: true
110+
flags: unittests
111+
files: ./coverage.xml
112+
verbose: false
113+
token: ${{ secrets.CODECOV_TOKEN }}
114+
name: codecov-${{env.GITHUB_REF_NAME}}

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pytest.xml
1313
*.py[co]
1414
*.egg-info
1515
*.sqlite
16-
dist/*
16+
dist
1717
docs/site
18-
stubs/
18+
stubs/
19+
uv.lock

.readthedocs.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)