django-dynamic-admin-forms 3.0.4__tar.gz → 3.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/.ambient-package-update/metadata.py +9 -3
  2. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/.ambient-package-update/templates/snippets/content.tpl +20 -21
  3. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/.ambient-package-update/templates/snippets/installation.tpl +4 -4
  4. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/.github/workflows/ci.yml +10 -9
  5. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/.pre-commit-config.yaml +5 -5
  6. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/CHANGES.md +24 -0
  7. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/PKG-INFO +7 -7
  8. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/README.md +0 -1
  9. django_dynamic_admin_forms-3.2.2/SECURITY.md +18 -0
  10. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/django_dynamic_admin_forms/__init__.py +1 -1
  11. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/docs/conf.py +0 -2
  12. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/pyproject.toml +26 -17
  13. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/tests/test_admin_unit.py +0 -2
  14. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/.coveragerc +0 -0
  15. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/.editorconfig +0 -0
  16. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/.gitignore +0 -0
  17. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/.python-version +0 -0
  18. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/.readthedocs.yaml +0 -0
  19. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/LICENSE.md +0 -0
  20. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/MANIFEST.in +0 -0
  21. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/django_dynamic_admin_forms/admin.py +0 -0
  22. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/django_dynamic_admin_forms/apps.py +0 -0
  23. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/django_dynamic_admin_forms/static/js/dynamic_admin.js +0 -0
  24. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/django_dynamic_admin_forms/templates/admin/change_form.html +0 -0
  25. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/django_dynamic_admin_forms/urls.py +0 -0
  26. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/docs/Makefile +0 -0
  27. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/docs/demo.gif +0 -0
  28. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/docs/features/changelog.rst +0 -0
  29. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/docs/index.rst +0 -0
  30. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/docs/make.bat +0 -0
  31. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/e2e/cypress/integration/dynamic-select.spec.js +0 -0
  32. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/e2e/cypress/plugins/index.js +0 -0
  33. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/e2e/cypress/support/commands.js +0 -0
  34. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/e2e/cypress/support/index.js +0 -0
  35. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/e2e/cypress/support/paths.js +0 -0
  36. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/e2e/cypress.json +0 -0
  37. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/e2e/package.json +0 -0
  38. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/e2e/yarn.lock +0 -0
  39. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/fixtures/fixtures-dev.json +0 -0
  40. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/manage.py +0 -0
  41. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/scripts/unix/install_requirements.sh +0 -0
  42. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/scripts/unix/publish_to_pypi.sh +0 -0
  43. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/scripts/windows/install_requirements.ps1 +0 -0
  44. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/scripts/windows/publish_to_pypi.ps1 +0 -0
  45. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/settings.py +0 -0
  46. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/setup.cfg +0 -0
  47. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/testapp/__init__.py +0 -0
  48. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/testapp/admin.py +0 -0
  49. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/testapp/apps.py +0 -0
  50. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/testapp/migrations/0001_initial.py +0 -0
  51. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/testapp/migrations/0002_extend_example.py +0 -0
  52. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/testapp/migrations/0003_example_file_field.py +0 -0
  53. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/testapp/migrations/__init__.py +0 -0
  54. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/testapp/models.py +0 -0
  55. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/testapp/urls.py +0 -0
  56. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/tests/__init__.py +0 -0
  57. {django_dynamic_admin_forms-3.0.4 → django_dynamic_admin_forms-3.2.2}/tests/test_admin_generic.py +0 -0
@@ -7,10 +7,11 @@ from ambient_package_update.metadata.constants import (
7
7
  from ambient_package_update.metadata.maintainer import PackageMaintainer
8
8
  from ambient_package_update.metadata.package import PackageMetadata
9
9
  from ambient_package_update.metadata.readme import ReadmeContent
10
+ from ambient_package_update.metadata.ruff_ignored_inspection import RuffIgnoredInspection
10
11
 
11
12
  METADATA = PackageMetadata(
12
13
  package_name="django_dynamic_admin_forms",
13
- module_name="django_dynamic_admin_forms",
14
+ github_package_group="ambient-innovation",
14
15
  github_package_name="django_dynamic_admin",
15
16
  company="Ambient Innovation: GmbH",
16
17
  authors=[
@@ -33,7 +34,7 @@ METADATA = PackageMetadata(
33
34
  supported_django_versions=SUPPORTED_DJANGO_VERSIONS,
34
35
  supported_python_versions=SUPPORTED_PYTHON_VERSIONS,
35
36
  dependencies=[
36
- "django >=3.2",
37
+ f"Django>={SUPPORTED_DJANGO_VERSIONS[0]}",
37
38
  ],
38
39
  optional_dependencies={
39
40
  "dev": [
@@ -41,5 +42,10 @@ METADATA = PackageMetadata(
41
42
  "unittest-parametrize~=1.4",
42
43
  ],
43
44
  },
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
+ ],
45
51
  )
@@ -16,8 +16,8 @@ Add simple interactions to the otherwise static django admin.
16
16
  - Add the module to `INSTALLED_APPS`:
17
17
  ```python
18
18
  INSTALLED_APPS = (
19
- 'django_dynamic_admin_forms',
20
- 'django.contrib.admin',
19
+ "django_dynamic_admin_forms",
20
+ "django.contrib.admin",
21
21
  )
22
22
  ```
23
23
  Ensure that the `dynamic_admin_forms` comes before the
@@ -28,8 +28,8 @@ Add simple interactions to the otherwise static django admin.
28
28
  ```python
29
29
  TEMPLATES = [
30
30
  {
31
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
32
- 'APP_DIRS': True,
31
+ "BACKEND": "django.template.backends.django.DjangoTemplates",
32
+ "APP_DIRS": True,
33
33
  },
34
34
  ]
35
35
  ```
@@ -43,8 +43,8 @@ Add simple interactions to the otherwise static django admin.
43
43
  from django.urls import path, include
44
44
 
45
45
  urlpatterns = [
46
- path("admin/", admin.site.urls),
47
- path("dynamic-admin-form/", include("django_dynamic_admin_forms.urls")),
46
+ path("admin/", admin.site.urls),
47
+ path("dynamic-admin-form/", include("django_dynamic_admin_forms.urls")),
48
48
  ]
49
49
  ```
50
50
  - In addition to the standard `fields` declaration, specify a list of `dynamic_fields`
@@ -65,23 +65,22 @@ Add simple interactions to the otherwise static django admin.
65
65
 
66
66
  @admin.register(MyModel)
67
67
  class MyModelAdmin(DynamicModelAdminMixin, admin.ModelAdmin):
68
- fields = ("name", "city")
69
- dynamic_fields = ("city",)
70
-
71
- def get_dynamic_city_field(self, data):
72
- # automatically choose first city that matches first letter of name
73
- name = data.get("name")
74
- if not name:
75
- queryset = City.objects.all()
76
- value = data.get("city")
77
- else:
78
- queryset = City.objects.filter(name__startswith=name[0])
79
- value = queryset.first()
80
- hidden = not queryset.exists()
81
- return queryset, value, hidden
68
+ fields = ("name", "city")
69
+ dynamic_fields = ("city",)
70
+
71
+ def get_dynamic_city_field(self, data):
72
+ # automatically choose first city that matches first letter of name
73
+ name = data.get("name")
74
+ if not name:
75
+ queryset = City.objects.all()
76
+ value = data.get("city")
77
+ else:
78
+ queryset = City.objects.filter(name__startswith=name[0])
79
+ value = queryset.first()
80
+ hidden = not queryset.exists()
81
+ return queryset, value, hidden
82
82
  ```
83
83
 
84
-
85
84
  ## How it works
86
85
  Whenever a dynamic form changes, an event handler makes a request to a special endpoint, which returns new HTML to swap
87
86
  into the existing form. This new HTML is directly generated by `django.contrib.admin`, so we only have to set the
@@ -11,8 +11,8 @@
11
11
  - Add the module to `INSTALLED_APPS`:
12
12
  ```python
13
13
  INSTALLED_APPS = (
14
- 'django_dynamic_admin_forms',
15
- 'django.contrib.admin',
14
+ "django_dynamic_admin_forms",
15
+ "django.contrib.admin",
16
16
  )
17
17
  ```
18
18
  Ensure that the `dynamic_admin_forms` comes before the
@@ -24,8 +24,8 @@
24
24
  ```python
25
25
  TEMPLATES = [
26
26
  {
27
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
28
- 'APP_DIRS': True,
27
+ "BACKEND": "django.template.backends.django.DjangoTemplates",
28
+ "APP_DIRS": True,
29
29
  },
30
30
  ]
31
31
  ```
@@ -27,14 +27,14 @@ jobs:
27
27
  runs-on: ubuntu-22.04
28
28
  strategy:
29
29
  matrix:
30
- python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', ]
31
- django-version: ['42', '50', ]
30
+ python-version: ['3.9', '3.10', '3.11', '3.12', ]
31
+ django-version: ['42', '50', '51', ]
32
32
 
33
33
  exclude:
34
- - python-version: '3.8'
35
- django-version: 50
36
34
  - python-version: '3.9'
37
35
  django-version: 50
36
+ - python-version: '3.9'
37
+ django-version: 51
38
38
 
39
39
  steps:
40
40
  - uses: actions/checkout@v4
@@ -49,9 +49,9 @@ jobs:
49
49
  TOXENV: django${{ matrix.django-version }}
50
50
  run: tox
51
51
  - name: Upload coverage data
52
- uses: actions/upload-artifact@v3
52
+ uses: actions/upload-artifact@v4
53
53
  with:
54
- name: coverage-data
54
+ name: coverage-data-${{ matrix.python-version }}-${{ matrix.django-version }}
55
55
  path: '.coverage*'
56
56
 
57
57
  coverage:
@@ -69,11 +69,12 @@ jobs:
69
69
  run: python -m pip install --upgrade coverage[toml]
70
70
 
71
71
  - name: Download data
72
- uses: actions/download-artifact@v3
72
+ uses: actions/download-artifact@v4
73
73
  with:
74
- name: coverage-data
74
+ pattern: coverage-data*
75
+ merge-multiple: true
75
76
 
76
- - name: Combine coverage and fail if it's <100%
77
+ - name: Combine coverage and fail if it's <100.0%
77
78
  run: |
78
79
  python -m coverage html --skip-covered --skip-empty
79
80
  python -m coverage report --fail-under=100.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  repos:
5
5
  - repo: https://github.com/astral-sh/ruff-pre-commit
6
- rev: v0.4.8
6
+ rev: v0.6.4
7
7
  hooks:
8
8
  # Run the Ruff linter.
9
9
  - id: ruff
@@ -12,7 +12,7 @@ repos:
12
12
  - id: ruff-format
13
13
 
14
14
  - repo: https://github.com/adamchainz/blacken-docs
15
- rev: 1.16.0
15
+ rev: 1.18.0
16
16
  hooks:
17
17
  - id: blacken-docs
18
18
  additional_dependencies:
@@ -20,14 +20,14 @@ repos:
20
20
  files: '(?:README\.md|docs\/.*\.(?:md|rst))'
21
21
 
22
22
  - repo: https://github.com/asottile/pyupgrade
23
- rev: v3.16.0
23
+ rev: v3.17.0
24
24
  hooks:
25
25
  - id: pyupgrade
26
- args: [ --py38-plus ]
26
+ args: [ --py39-plus ]
27
27
  stages: [ push ]
28
28
 
29
29
  - repo: https://github.com/adamchainz/django-upgrade
30
- rev: 1.18.0
30
+ rev: 1.21.0
31
31
  hooks:
32
32
  - id: django-upgrade
33
33
  args: [--target-version, "4.2"]
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ * *3.2.2* (2024-09-11)
4
+ * Fixed package name
5
+
6
+ **3.2.1**
7
+ * Fixed test matrix
8
+
9
+ **3.2.0**
10
+ * Added Django 5.1 support
11
+
12
+ **3.1.3**
13
+ * Added SECURITY.md
14
+ * Updated linters
15
+ * Internal updates via `ambient-package-update`
16
+
17
+ **3.1.2**
18
+ * Updated GitHub actions
19
+
20
+ **3.1.1**
21
+ * Black-end documentation code
22
+
23
+ **3.1.0**
24
+ * Dropped support for Python 3.8
25
+ * Added multiple ruff linters
26
+
3
27
  **3.0.4**
4
28
  * Linted docs with `blacken-docs` via `ambient-package-update`
5
29
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-dynamic-admin-forms
3
- Version: 3.0.4
3
+ Version: 3.2.2
4
4
  Summary: Add simple dynamic interaction to the otherwise static django admin.
5
5
  Author-email: Ambient Digital <hello@ambient.digital>, Fabian Binz <fabian.binz@ambient.digital>
6
6
  Description-Content-Type: text/markdown
@@ -9,32 +9,33 @@ Classifier: Environment :: Web Environment
9
9
  Classifier: Framework :: Django
10
10
  Classifier: Framework :: Django :: 4.2
11
11
  Classifier: Framework :: Django :: 5.0
12
+ Classifier: Framework :: Django :: 5.1
12
13
  Classifier: Intended Audience :: Developers
13
14
  Classifier: License :: OSI Approved :: MIT License
14
15
  Classifier: Natural Language :: English
15
16
  Classifier: Operating System :: OS Independent
16
17
  Classifier: Programming Language :: Python
17
18
  Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.8
19
19
  Classifier: Programming Language :: Python :: 3.9
20
20
  Classifier: Programming Language :: Python :: 3.10
21
21
  Classifier: Programming Language :: Python :: 3.11
22
22
  Classifier: Programming Language :: Python :: 3.12
23
23
  Classifier: Topic :: Utilities
24
- Requires-Dist: django >=3.2
24
+ Requires-Dist: Django>=4.2
25
25
  Requires-Dist: typer~=0.9 ; extra == "dev"
26
26
  Requires-Dist: freezegun~=1.3 ; extra == "dev"
27
27
  Requires-Dist: pytest-django~=4.7 ; extra == "dev"
28
28
  Requires-Dist: pytest-mock~=3.12 ; extra == "dev"
29
29
  Requires-Dist: coverage~=7.3 ; extra == "dev"
30
- Requires-Dist: pre-commit~=3.5 ; extra == "dev"
31
- Requires-Dist: ruff~=0.1.7 ; extra == "dev"
30
+ Requires-Dist: pre-commit~=3.7 ; extra == "dev"
31
+ Requires-Dist: ruff~=0.4 ; extra == "dev"
32
32
  Requires-Dist: sphinx~=7.1 ; extra == "dev"
33
33
  Requires-Dist: sphinx-rtd-theme~=2.0 ; extra == "dev"
34
34
  Requires-Dist: m2r2==0.3.3.post2 ; extra == "dev"
35
35
  Requires-Dist: mistune<2.0.0 ; extra == "dev"
36
36
  Requires-Dist: flit~=3.9 ; extra == "dev"
37
- Requires-Dist: ambient-package-update~=24.6.4 ; extra == "dev"
37
+ Requires-Dist: keyring~=25.2 ; extra == "dev"
38
+ Requires-Dist: ambient-package-update ; extra == "dev"
38
39
  Requires-Dist: unittest-parametrize~=1.4 ; extra == "dev"
39
40
  Project-URL: Bugtracker, https://github.com/ambient-innovation/django-dynamic-admin/issues
40
41
  Project-URL: Changelog, https://django-dynamic-admin-forms.readthedocs.io/en/latest/features/changelog.html
@@ -141,7 +142,6 @@ Add simple interactions to the otherwise static django admin.
141
142
  return queryset, value, hidden
142
143
  ```
143
144
 
144
-
145
145
  ## How it works
146
146
  Whenever a dynamic form changes, an event handler makes a request to a special endpoint, which returns new HTML to swap
147
147
  into the existing form. This new HTML is directly generated by `django.contrib.admin`, so we only have to set the
@@ -96,7 +96,6 @@ Add simple interactions to the otherwise static django admin.
96
96
  return queryset, value, hidden
97
97
  ```
98
98
 
99
-
100
99
  ## How it works
101
100
  Whenever a dynamic form changes, an event handler makes a request to a special endpoint, which returns new HTML to swap
102
101
  into the existing form. This new HTML is directly generated by `django.contrib.admin`, so we only have to set the
@@ -0,0 +1,18 @@
1
+ # Reporting Security Issues
2
+
3
+ The maintainers of this package take security bugs seriously. We appreciate your efforts to responsibly
4
+ disclose your findings, and will make every effort to acknowledge your contributions.
5
+
6
+ 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)
8
+ tab.
9
+
10
+ The maintainers will send a response indicating the next steps in handling your report. After the initial reply to
11
+ your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask
12
+ for additional information or guidance.
13
+
14
+ Report security bugs in third-party modules to the person or team maintaining the module.
15
+
16
+ ## Source
17
+
18
+ This file was inspired by: https://github.com/electron/electron/blob/main/SECURITY.md
@@ -1,3 +1,3 @@
1
1
  """Add simple dynamic interaction to the otherwise static django admin."""
2
2
 
3
- __version__ = "3.0.4"
3
+ __version__ = "3.2.2"
@@ -67,8 +67,6 @@ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
67
67
 
68
68
  # The theme to use for HTML and HTML Help pages. See the documentation for
69
69
  # a list of builtin themes.
70
- #
71
- # html_theme = "alabaster"
72
70
  html_theme = "sphinx_rtd_theme"
73
71
  html_theme_options = {
74
72
  "display_version": False,
@@ -15,13 +15,13 @@ classifiers = [
15
15
  "Framework :: Django",
16
16
  "Framework :: Django :: 4.2",
17
17
  "Framework :: Django :: 5.0",
18
+ "Framework :: Django :: 5.1",
18
19
  "Intended Audience :: Developers",
19
20
  "License :: OSI Approved :: MIT License",
20
21
  "Natural Language :: English",
21
22
  "Operating System :: OS Independent",
22
23
  "Programming Language :: Python",
23
24
  "Programming Language :: Python :: 3",
24
- "Programming Language :: Python :: 3.8",
25
25
  "Programming Language :: Python :: 3.9",
26
26
  "Programming Language :: Python :: 3.10",
27
27
  "Programming Language :: Python :: 3.11",
@@ -31,7 +31,7 @@ classifiers = [
31
31
  dynamic = ["version", "description"]
32
32
  license = {"file" = "LICENSE.md"}
33
33
  dependencies = [
34
- 'django >=3.2',
34
+ 'Django>=4.2',
35
35
  ]
36
36
 
37
37
 
@@ -42,14 +42,15 @@ dev = [
42
42
  'pytest-django~=4.7',
43
43
  'pytest-mock~=3.12',
44
44
  'coverage~=7.3',
45
- 'pre-commit~=3.5',
46
- 'ruff~=0.1.7',
45
+ 'pre-commit~=3.7',
46
+ 'ruff~=0.4',
47
47
  'sphinx~=7.1',
48
48
  'sphinx-rtd-theme~=2.0',
49
49
  'm2r2==0.3.3.post2',
50
50
  'mistune<2.0.0',
51
51
  'flit~=3.9',
52
- 'ambient-package-update~=24.6.4',
52
+ 'keyring~=25.2',
53
+ 'ambient-package-update',
53
54
  'unittest-parametrize~=1.4',
54
55
  ]
55
56
 
@@ -75,18 +76,25 @@ lint.select = [
75
76
  "DTZ", # flake8-datetimez
76
77
  "DJ", # flake8-django
77
78
  "TD", # flake8-to-do
78
- "RUF100", # Removes unnecessary "#noqa" comments
79
+ "RUF", # Ruff-specific rules
79
80
  "YTT", # Avoid non-future-prove usages of "sys"
80
- # "FBT", # Protects you from the "boolean trap bug"
81
81
  "C4", # Checks for unnecessary conversions
82
82
  "PIE", # Bunch of useful rules
83
- # "SIM", # Simplifies your code
84
83
  "INT", # Validates your gettext translation strings
85
84
  "PERF", # PerfLint
86
85
  "PGH", # No all-purpose "# noqa" and eval validation
87
86
  "PL", # PyLint
87
+ "LOG", # flake8-logging
88
+ "TID", # flake8-tidy-imports
89
+ "PLR2004", # Magic numbers
90
+ "BLE", # Checks for except clauses that catch all exceptions
91
+ "ANN401", # Checks that function arguments are annotated with a more specific type than Any
92
+ "TRY", # Clean try/except
93
+ "ERA", # Commented out code
88
94
  ]
89
95
  lint.ignore = [
96
+ 'RUF012', # Mutable class attributes should be annotated with `typing.ClassVar`
97
+ 'TRY003', # Avoid specifying long messages outside the exception class
90
98
  ]
91
99
 
92
100
  # Allow autofix for all enabled rules (when `--fix`) is provided.
@@ -101,16 +109,21 @@ lint.fixable = [
101
109
  "DTZ", # flake8-datetimez
102
110
  "DJ", # flake8-django
103
111
  "TD", # flake8-to-do
104
- "RUF100", # Removes unnecessary "#noqa" comments
112
+ "RUF", # Ruff-specific rules
105
113
  "YTT", # Avoid non-future-prove usages of "sys"
106
- # "FBT", # Protects you from the "boolean trap bug"
107
114
  "C4", # Checks for unnecessary conversions
108
115
  "PIE", # Bunch of useful rules
109
- # "SIM", # Simplifies your code
110
116
  "INT", # Validates your gettext translation strings
111
117
  "PERF", # PerfLint
112
118
  "PGH", # No all-purpose "# noqa" and eval validation
113
119
  "PL", # PyLint
120
+ "LOG", # flake8-logging
121
+ "TID", # flake8-tidy-imports
122
+ "PLR2004", # Magic numbers
123
+ "BLE", # Checks for except clauses that catch all exceptions
124
+ "ANN401", # Checks that function arguments are annotated with a more specific type than Any
125
+ "TRY", # Clean try/except
126
+ "ERA", # Commented out code
114
127
  ]
115
128
  lint.unfixable = []
116
129
 
@@ -142,7 +155,7 @@ exclude = [
142
155
  line-length = 120
143
156
 
144
157
  # Allow unused variables when underscore-prefixed.
145
- dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
158
+ lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
146
159
 
147
160
  # Assume Python 3.12
148
161
  target-version = "py312"
@@ -162,22 +175,18 @@ line-ending = "auto"
162
175
 
163
176
  [tool.tox]
164
177
  legacy_tox_ini = """
165
- [tox]
166
- envlist = py{38,39,310,311}-django{32,41,42}
167
- isolated_build = True
168
-
169
178
  [testenv]
170
179
  # Django deprecation overview: https://www.djangoproject.com/download/
171
180
  deps =
172
181
  django42: Django==4.2.*
173
182
  django50: Django==5.0.*
183
+ django51: Django==5.1.*
174
184
  extras = dev,
175
185
  commands =
176
186
  coverage run -m pytest --ds settings tests
177
187
 
178
188
  [gh-actions]
179
189
  python =
180
- 3.8: py38
181
190
  3.9: py39
182
191
  3.10: py310
183
192
  3.11: py311
@@ -21,8 +21,6 @@ class TestDynamicModelAdminMixin(TestCase):
21
21
  @classmethod
22
22
  def setUpTestData(cls):
23
23
  pass
24
- # cls.mixin = DynamicModelAdminMixin()
25
- # cls.mixin.opts = site._registry[User]
26
24
 
27
25
  def get_request(self, is_superuser: bool):
28
26
  factory = RequestFactory()