Skip to content

Commit 94d8863

Browse files
authored
Updater updates (#17)
1 parent dba787f commit 94d8863

File tree

10 files changed

+110
-103
lines changed

10 files changed

+110
-103
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
run: pip install pre-commit
2222

2323
- name: Run pre-commit hooks
24-
run: pre-commit run --all-files --hook-stage push
24+
run: pre-commit run --all-files
2525

2626

2727
tests:

.pre-commit-config.yaml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
repos:
55
- repo: https://github.com/astral-sh/ruff-pre-commit
6-
rev: v0.11.2
6+
rev: v0.11.11
77
hooks:
88
# Run the Ruff formatter.
99
- id: ruff-format
1010
# Run the Ruff linter.
11-
- id: ruff
11+
- id: ruff-check
1212
args: [--fix, --exit-non-zero-on-fix]
1313

1414
- repo: https://github.com/adamchainz/blacken-docs
@@ -20,19 +20,19 @@ repos:
2020
files: '(?:README\.md|\.ambient-package-update\/templates\/snippets\/.*\.tpl|docs\/.*\.(?:md|rst))'
2121

2222
- repo: https://github.com/asottile/pyupgrade
23-
rev: v3.19.1
23+
rev: v3.20.0
2424
hooks:
2525
- id: pyupgrade
2626
args: [ --py39-plus ]
2727

2828
- repo: https://github.com/adamchainz/django-upgrade
29-
rev: 1.24.0
29+
rev: 1.25.0
3030
hooks:
3131
- id: django-upgrade
3232
args: [--target-version, "4.2"]
3333

3434
- repo: https://github.com/adamchainz/djade-pre-commit
35-
rev: 1.3.2
35+
rev: 1.4.0
3636
hooks:
3737
- id: djade
3838
args: [--target-version, "4.2"]
@@ -45,10 +45,15 @@ repos:
4545
- repo: https://github.com/pre-commit/pre-commit-hooks
4646
rev: v5.0.0
4747
hooks:
48-
- id: no-commit-to-branch
49-
args:
50-
[
51-
"--pattern",
52-
'^^(?!(?:feature|hotfix|bugfix|refactor|maintenance)/[\w\d\-_#]+).*$',
53-
]
54-
stages: [ pre-commit ]
48+
- id: check-ast
49+
- id: check-builtin-literals
50+
- id: check-case-conflict
51+
- id: check-docstring-first
52+
- id: check-executables-have-shebangs
53+
- id: check-json
54+
- id: check-merge-conflict
55+
- id: check-toml
56+
- id: end-of-file-fixer
57+
- id: fix-byte-order-marker
58+
- id: mixed-line-ending
59+
- id: trailing-whitespace

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
**3.2.9** (2025-05-29)
4+
* Maintenance updates via ambient-package-update
5+
36
**3.2.8** (2025-04-03)
47
* Maintenance updates via ambient-package-update
58

CONTRIBUTING.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Contribute
2+
3+
## Setup package for development
4+
5+
- Create a Python virtualenv and activate it
6+
- Install "pip-tools" with `pip install -U pip-tools`
7+
- Compile the requirements with `pip-compile --extra dev, -o requirements.txt pyproject.toml --resolver=backtracking`
8+
- Sync the dependencies with your virtualenv with `pip-sync`
9+
10+
## Add functionality
11+
12+
- Create a new branch for your feature
13+
- Change the dependency in your requirements.txt to a local (editable) one that points to your local file system:
14+
`-e /Users/workspace/django-dynamic-admin-forms` or via pip `pip install -e /Users/workspace/django-dynamic-admin-forms`
15+
- Ensure the code passes the tests
16+
- Create a pull request
17+
18+
## Run tests
19+
20+
- Run tests
21+
````
22+
pytest --ds settings tests
23+
````
24+
25+
- Check coverage
26+
````
27+
coverage run -m pytest --ds settings tests
28+
coverage report -m
29+
````
30+
31+
## Git hooks (via pre-commit)
32+
33+
We use pre-push hooks to ensure that only linted code reaches our remote repository and pipelines aren't triggered in
34+
vain.
35+
36+
To enable the configured pre-push hooks, you need to [install](https://pre-commit.com/) pre-commit and run once:
37+
38+
pre-commit install -t pre-push -t pre-commit --install-hooks
39+
40+
This will permanently install the git hooks for both, frontend and backend, in your local
41+
[`.git/hooks`](./.git/hooks) folder.
42+
The hooks are configured in the [`.pre-commit-config.yaml`](templates/.pre-commit-config.yaml.tpl).
43+
44+
You can check whether hooks work as intended using the [run](https://pre-commit.com/#pre-commit-run) command:
45+
46+
pre-commit run [hook-id] [options]
47+
48+
Example: run single hook
49+
50+
pre-commit run ruff --all-files
51+
52+
Example: run all hooks of pre-push stage
53+
54+
pre-commit run --all-files
55+
56+
## Update documentation
57+
58+
- To build the documentation, run: `sphinx-build docs/ docs/_build/html/`.
59+
- Open `docs/_build/html/index.html` to see the documentation.
60+
61+
62+
### Translation files
63+
64+
If you have added custom text, make sure to wrap it in `_()` where `_` is
65+
gettext_lazy (`from django.utils.translation import gettext_lazy as _`).
66+
67+
How to create translation file:
68+
69+
* Navigate to `django-dynamic-admin-forms`
70+
* `python manage.py makemessages -l de`
71+
* Have a look at the new/changed files within `django_dynamic_admin_forms/locale`
72+
73+
How to compile translation files:
74+
75+
* Navigate to `django-dynamic-admin-forms`
76+
* `python manage.py compilemessages`
77+
* Have a look at the new/changed files within `django_dynamic_admin_forms/locale`

README.md

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -172,85 +172,6 @@ $ yarn cypress # or npm run cypress
172172

173173
- Run `python manage.py collectstatic` to include this apps Javascript code in your `settings.STATIC_ROOT` directory
174174

175-
## Contribute
176-
177-
### Setup package for development
178-
179-
- Create a Python virtualenv and activate it
180-
- Install "pip-tools" with `pip install -U pip-tools`
181-
- Compile the requirements with `pip-compile --extra dev, -o requirements.txt pyproject.toml --resolver=backtracking`
182-
- Sync the dependencies with your virtualenv with `pip-sync`
183-
184-
### Add functionality
185-
186-
- Create a new branch for your feature
187-
- Change the dependency in your requirements.txt to a local (editable) one that points to your local file system:
188-
`-e /Users/workspace/django-dynamic-admin-forms` or via pip `pip install -e /Users/workspace/django-dynamic-admin-forms`
189-
- Ensure the code passes the tests
190-
- Create a pull request
191-
192-
### Run tests
193-
194-
- Run tests
195-
````
196-
pytest --ds settings tests
197-
````
198-
199-
- Check coverage
200-
````
201-
coverage run -m pytest --ds settings tests
202-
coverage report -m
203-
````
204-
205-
### Git hooks (via pre-commit)
206-
207-
We use pre-push hooks to ensure that only linted code reaches our remote repository and pipelines aren't triggered in
208-
vain.
209-
210-
To enable the configured pre-push hooks, you need to [install](https://pre-commit.com/) pre-commit and run once:
211-
212-
pre-commit install -t pre-push -t pre-commit --install-hooks
213-
214-
This will permanently install the git hooks for both, frontend and backend, in your local
215-
[`.git/hooks`](./.git/hooks) folder.
216-
The hooks are configured in the [`.pre-commit-config.yaml`](templates/.pre-commit-config.yaml.tpl).
217-
218-
You can check whether hooks work as intended using the [run](https://pre-commit.com/#pre-commit-run) command:
219-
220-
pre-commit run [hook-id] [options]
221-
222-
Example: run single hook
223-
224-
pre-commit run ruff --all-files
225-
226-
Example: run all hooks of pre-push stage
227-
228-
pre-commit run --all-files --hook-stage push
229-
230-
### Update documentation
231-
232-
- To build the documentation, run: `sphinx-build docs/ docs/_build/html/`.
233-
- Open `docs/_build/html/index.html` to see the documentation.
234-
235-
236-
### Translation files
237-
238-
If you have added custom text, make sure to wrap it in `_()` where `_` is
239-
gettext_lazy (`from django.utils.translation import gettext_lazy as _`).
240-
241-
How to create translation file:
242-
243-
* Navigate to `django-dynamic-admin-forms`
244-
* `python manage.py makemessages -l de`
245-
* Have a look at the new/changed files within `django_dynamic_admin_forms/locale`
246-
247-
How to compile translation files:
248-
249-
* Navigate to `django-dynamic-admin-forms`
250-
* `python manage.py compilemessages`
251-
* Have a look at the new/changed files within `django_dynamic_admin_forms/locale`
252-
253-
254175
### Publish to ReadTheDocs.io
255176

256177
- Fetch the latest changes in GitHub mirror and push them
@@ -287,4 +208,3 @@ configuration and setup files. It works similar to well-known updaters like `pyu
287208

288209
To run an update, refer to the [documentation page](https://pypi.org/project/ambient-package-update/)
289210
of the "ambient-package-update".
290-

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The maintainers of this package take security bugs seriously. We appreciate your
44
disclose your findings, and will make every effort to acknowledge your contributions.
55

66
To report a security issue, please use the GitHub Security
7-
Advisory ["Report a Vulnerability"](https://github.com/ambient-innovation/django-dynamic-admin/security/advisories/new)
7+
Advisory ["Report a Vulnerability"](https://github.com/ambient-innovation/django-dynamic-admin/security/advisories/new)
88
tab.
99

1010
The maintainers will send a response indicating the next steps in handling your report. After the initial reply to
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Add simple dynamic interaction to the otherwise static django admin."""
22

3-
__version__ = "3.2.8"
3+
__version__ = "3.2.9"

docs/features/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.. mdinclude:: ../../CHANGES.md
1+
.. mdinclude:: ../../CHANGES.md

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
:maxdepth: 1
55
:caption: Contents:
66

7-
features/changelog.md
7+
features/changelog.md

pyproject.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ dev = [
4444
'pytest-django~=4.9',
4545
'pytest-mock~=3.14',
4646
'coverage~=7.6',
47-
'pre-commit~=4.0',
48-
'ruff~=0.6',
47+
'pre-commit~=4.2',
48+
'ruff~=0.11',
4949
'sphinx~=7.1',
5050
'sphinx-rtd-theme~=2.0',
5151
'm2r2==0.3.3.post2',
5252
'mistune<2.0.0',
53-
'flit~=3.9',
54-
'keyring~=25.4',
53+
'flit~=3.12',
54+
'keyring~=25.6',
5555
'ambient-package-update',
5656
'unittest-parametrize~=1.4',
5757
]
@@ -93,7 +93,8 @@ lint.select = [
9393
"ANN401", # Checks that function arguments are annotated with a more specific type than Any
9494
"TRY", # Clean try/except
9595
"ERA", # Commented out code
96-
"INP" # Ban PEP-420 implicit namespace packages
96+
"INP", # Ban PEP-420 implicit namespace packages
97+
"C90", # McCabe code complexity
9798
]
9899
lint.ignore = [
99100
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
@@ -127,7 +128,8 @@ lint.fixable = [
127128
"ANN401", # Checks that function arguments are annotated with a more specific type than Any
128129
"TRY", # Clean try/except
129130
"ERA", # Commented out code
130-
"INP" # Ban PEP-420 implicit namespace packages
131+
"INP", # Ban PEP-420 implicit namespace packages
132+
"C90", # McCabe code complexity
131133
]
132134
lint.unfixable = []
133135

0 commit comments

Comments
 (0)