Skip to content

Commit 969c6b2

Browse files
committed
v3.1.0
1 parent 191d8ab commit 969c6b2

File tree

9 files changed

+45
-34
lines changed

9 files changed

+45
-34
lines changed

.ambient-package-update/metadata.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from ambient_package_update.metadata.maintainer import PackageMaintainer
88
from ambient_package_update.metadata.package import PackageMetadata
99
from ambient_package_update.metadata.readme import ReadmeContent
10+
from ambient_package_update.metadata.ruff_ignored_inspection import RuffIgnoredInspection
1011

1112
METADATA = PackageMetadata(
1213
package_name="django_dynamic_admin_forms",
@@ -33,13 +34,18 @@
3334
supported_django_versions=SUPPORTED_DJANGO_VERSIONS,
3435
supported_python_versions=SUPPORTED_PYTHON_VERSIONS,
3536
dependencies=[
36-
"django >=3.2",
37+
f"Django>={SUPPORTED_DJANGO_VERSIONS[0]}",
3738
],
3839
optional_dependencies={
3940
"dev": [
4041
*DEV_DEPENDENCIES,
4142
"unittest-parametrize~=1.4",
4243
],
4344
},
44-
ruff_ignore_list=[],
45+
ruff_ignore_list=[
46+
RuffIgnoredInspection(
47+
key="RUF012", comment="Mutable class attributes should be annotated with `typing.ClassVar`"
48+
),
49+
RuffIgnoredInspection(key="TRY003", comment="Avoid specifying long messages outside the exception class"),
50+
],
4551
)

.ambient-package-update/templates/snippets/content.tpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Add simple interactions to the otherwise static django admin.
1616
- Add the module to `INSTALLED_APPS`:
1717
```python
1818
INSTALLED_APPS = (
19-
'django_dynamic_admin_forms',
20-
'django.contrib.admin',
19+
"django_dynamic_admin_forms",
20+
"django.contrib.admin",
2121
)
2222
```
2323
Ensure that the `dynamic_admin_forms` comes before the
@@ -28,8 +28,8 @@ Add simple interactions to the otherwise static django admin.
2828
```python
2929
TEMPLATES = [
3030
{
31-
'BACKEND': 'django.template.backends.django.DjangoTemplates',
32-
'APP_DIRS': True,
31+
"BACKEND": "django.template.backends.django.DjangoTemplates",
32+
"APP_DIRS": True,
3333
},
3434
]
3535
```

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@ jobs:
2727
runs-on: ubuntu-22.04
2828
strategy:
2929
matrix:
30-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', ]
30+
python-version: ['3.9', '3.10', '3.11', '3.12', ]
3131
django-version: ['42', '50', ]
3232

3333
exclude:
34-
- python-version: '3.8'
35-
django-version: 50
3634
- python-version: '3.9'
3735
django-version: 50
3836

@@ -73,7 +71,7 @@ jobs:
7371
with:
7472
name: coverage-data
7573

76-
- name: Combine coverage and fail if it's <100%
74+
- name: Combine coverage and fail if it's <100.0%
7775
run: |
7876
python -m coverage html --skip-covered --skip-empty
7977
python -m coverage report --fail-under=100.0

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repos:
2323
rev: v3.16.0
2424
hooks:
2525
- id: pyupgrade
26-
args: [ --py38-plus ]
26+
args: [ --py39-plus ]
2727
stages: [ push ]
2828

2929
- repo: https://github.com/adamchainz/django-upgrade

CHANGES.md

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

3+
**3.1.0**
4+
* Dropped support for Python 3.8
5+
* Added multiple ruff linters
6+
37
**3.0.4**
48
* Linted docs with `blacken-docs` via `ambient-package-update`
59

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.0.4"
3+
__version__ = "3.1.0"

docs/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@
6767

6868
# The theme to use for HTML and HTML Help pages. See the documentation for
6969
# a list of builtin themes.
70-
#
71-
# html_theme = "alabaster"
7270
html_theme = "sphinx_rtd_theme"
7371
html_theme_options = {
7472
"display_version": False,

pyproject.toml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["flit_core>=3.4"]
33
build-backend = "flit_core.buildapi"
44

55
[project]
6-
name = "django-dynamic-admin-forms"
6+
name = "django_dynamic_admin_forms"
77
authors = [
88
{'name' = 'Ambient Digital', 'email' = '[email protected]'},
99
{'name' = 'Fabian Binz', 'email' = '[email protected]'},
@@ -21,7 +21,6 @@ classifiers = [
2121
"Operating System :: OS Independent",
2222
"Programming Language :: Python",
2323
"Programming Language :: Python :: 3",
24-
"Programming Language :: Python :: 3.8",
2524
"Programming Language :: Python :: 3.9",
2625
"Programming Language :: Python :: 3.10",
2726
"Programming Language :: Python :: 3.11",
@@ -31,7 +30,7 @@ classifiers = [
3130
dynamic = ["version", "description"]
3231
license = {"file" = "LICENSE.md"}
3332
dependencies = [
34-
'django >=3.2',
33+
'Django>=4.2',
3534
]
3635

3736

@@ -42,14 +41,15 @@ dev = [
4241
'pytest-django~=4.7',
4342
'pytest-mock~=3.12',
4443
'coverage~=7.3',
45-
'pre-commit~=3.5',
46-
'ruff~=0.1.7',
44+
'pre-commit~=3.7',
45+
'ruff~=0.4',
4746
'sphinx~=7.1',
4847
'sphinx-rtd-theme~=2.0',
4948
'm2r2==0.3.3.post2',
5049
'mistune<2.0.0',
5150
'flit~=3.9',
52-
'ambient-package-update~=24.6.4',
51+
'keyring~=25.2',
52+
'ambient-package-update~=24.7.3',
5353
'unittest-parametrize~=1.4',
5454
]
5555

@@ -75,18 +75,25 @@ lint.select = [
7575
"DTZ", # flake8-datetimez
7676
"DJ", # flake8-django
7777
"TD", # flake8-to-do
78-
"RUF100", # Removes unnecessary "#noqa" comments
78+
"RUF", # Ruff-specific rules
7979
"YTT", # Avoid non-future-prove usages of "sys"
80-
# "FBT", # Protects you from the "boolean trap bug"
8180
"C4", # Checks for unnecessary conversions
8281
"PIE", # Bunch of useful rules
83-
# "SIM", # Simplifies your code
8482
"INT", # Validates your gettext translation strings
8583
"PERF", # PerfLint
8684
"PGH", # No all-purpose "# noqa" and eval validation
8785
"PL", # PyLint
86+
"LOG", # flake8-logging
87+
"TID", # flake8-tidy-imports
88+
"PLR2004", # Magic numbers
89+
"BLE", # Checks for except clauses that catch all exceptions
90+
"ANN401", # Checks that function arguments are annotated with a more specific type than Any
91+
"TRY", # Clean try/except
92+
"ERA", # Commented out code
8893
]
8994
lint.ignore = [
95+
'RUF012', # Mutable class attributes should be annotated with `typing.ClassVar`
96+
'TRY003', # Avoid specifying long messages outside the exception class
9097
]
9198

9299
# Allow autofix for all enabled rules (when `--fix`) is provided.
@@ -101,16 +108,21 @@ lint.fixable = [
101108
"DTZ", # flake8-datetimez
102109
"DJ", # flake8-django
103110
"TD", # flake8-to-do
104-
"RUF100", # Removes unnecessary "#noqa" comments
111+
"RUF", # Ruff-specific rules
105112
"YTT", # Avoid non-future-prove usages of "sys"
106-
# "FBT", # Protects you from the "boolean trap bug"
107113
"C4", # Checks for unnecessary conversions
108114
"PIE", # Bunch of useful rules
109-
# "SIM", # Simplifies your code
110115
"INT", # Validates your gettext translation strings
111116
"PERF", # PerfLint
112117
"PGH", # No all-purpose "# noqa" and eval validation
113118
"PL", # PyLint
119+
"LOG", # flake8-logging
120+
"TID", # flake8-tidy-imports
121+
"PLR2004", # Magic numbers
122+
"BLE", # Checks for except clauses that catch all exceptions
123+
"ANN401", # Checks that function arguments are annotated with a more specific type than Any
124+
"TRY", # Clean try/except
125+
"ERA", # Commented out code
114126
]
115127
lint.unfixable = []
116128

@@ -142,7 +154,7 @@ exclude = [
142154
line-length = 120
143155

144156
# Allow unused variables when underscore-prefixed.
145-
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
157+
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
146158

147159
# Assume Python 3.12
148160
target-version = "py312"
@@ -162,10 +174,6 @@ line-ending = "auto"
162174

163175
[tool.tox]
164176
legacy_tox_ini = """
165-
[tox]
166-
envlist = py{38,39,310,311}-django{32,41,42}
167-
isolated_build = True
168-
169177
[testenv]
170178
# Django deprecation overview: https://www.djangoproject.com/download/
171179
deps =
@@ -177,7 +185,6 @@ commands =
177185
178186
[gh-actions]
179187
python =
180-
3.8: py38
181188
3.9: py39
182189
3.10: py310
183190
3.11: py311

tests/test_admin_unit.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ class TestDynamicModelAdminMixin(TestCase):
2121
@classmethod
2222
def setUpTestData(cls):
2323
pass
24-
# cls.mixin = DynamicModelAdminMixin()
25-
# cls.mixin.opts = site._registry[User]
2624

2725
def get_request(self, is_superuser: bool):
2826
factory = RequestFactory()

0 commit comments

Comments
 (0)