Skip to content

Commit f1dbab2

Browse files
committed
feat: Add DateRangeDateFilter and update dependencies
This commit introduces the new , allowing for more flexible filtering across date ranges. Additionally, project dependencies have been updated to their latest versions. This brings in new features, performance improvements, and important security patches, ensuring the project remains robust and secure. Key package upgrades include: - ruff (0.9.9 -> 0.14.5) - selenium (4.29.0 -> 4.38.0) - tox (4.24.1 -> 4.32.0) - urllib3 (2.2.3 -> 2.5.0) - virtualenv (20.29.2 -> 20.35.4) BREAKING CHANGE: Dropped support for older, unsupported versions of Python and Django. This change allows for modernizing the codebase and reducing maintenance overhead.
1 parent ff027b9 commit f1dbab2

24 files changed

+1880
-1301
lines changed

.pre-commit-config.yaml

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
11
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
4-
hooks:
5-
- id: end-of-file-fixer
6-
- id: trailing-whitespace
7-
- repo: https://github.com/python-jsonschema/check-jsonschema
8-
rev: 0.31.2
9-
hooks:
10-
- id: check-github-workflows
11-
args: [ "--verbose" ]
12-
- repo: https://github.com/tox-dev/tox-ini-fmt
13-
rev: "1.5.0"
14-
hooks:
15-
- id: tox-ini-fmt
16-
args: [ "-p", "lint" ]
17-
- repo: https://github.com/tox-dev/pyproject-fmt
18-
rev: "v2.5.1"
19-
hooks:
20-
- id: pyproject-fmt
21-
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: "v0.9.9"
23-
hooks:
24-
- id: ruff-format
25-
- id: ruff
26-
args: [ "--fix", "--unsafe-fixes", "--exit-non-zero-on-fix" ]
27-
# - repo: https://github.com/adamchainz/djade-pre-commit
28-
# rev: "1.3.2"
29-
# hooks:
30-
# - id: djade
31-
# args: [ --check, --target-version, "5.1" ]
32-
- repo: meta
33-
hooks:
34-
- id: check-hooks-apply
35-
- id: check-useless-excludes
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: trailing-whitespace
7+
- repo: https://github.com/python-jsonschema/check-jsonschema
8+
rev: 0.31.2
9+
hooks:
10+
- id: check-github-workflows
11+
args: [ "--verbose" ]
12+
- repo: https://github.com/tox-dev/tox-ini-fmt
13+
rev: "1.5.0"
14+
hooks:
15+
- id: tox-ini-fmt
16+
args: [ "-p", "lint" ]
17+
- repo: https://github.com/tox-dev/pyproject-fmt
18+
rev: "v2.5.1"
19+
hooks:
20+
- id: pyproject-fmt
21+
- repo: https://github.com/astral-sh/ruff-pre-commit
22+
rev: "v0.9.9"
23+
hooks:
24+
- id: ruff-format
25+
- id: ruff
26+
args: [ "--fix", "--unsafe-fixes", "--exit-non-zero-on-fix" ]
27+
- repo: meta
28+
hooks:
29+
- id: check-hooks-apply
30+
- id: check-useless-excludes
31+
32+
- repo: https://github.com/saxix/pch
33+
rev: '0.2'
34+
hooks:
35+
- id: check-minimized
36+
name: check missing minimized javascript
37+
files: (\.js)$
38+
exclude: (\.min\.js)$

djlint.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
profile = "django"
2+
include = "**/src/**/templates/*.html"
3+
extend_exclude = "docker/**,"
4+
ignore = "H006,H030"
5+
indent = 4
6+
max_line_length = 120
7+
max_attribute_length = 120
8+
close_void_tags=true
9+
line_break_after_multiline_tag=true
10+
11+
[tool.djlint.per-file-ignores]

mypy.ini

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[mypy]
2+
files = src/adminfilters, tests/demoapp/demo/admin.py
3+
mypy_path = $MYPY_CONFIG_FILE_DIR/src/:$MYPY_CONFIG_FILE_DIR/tests/demoapp
4+
;enable_error_code =
5+
; deprecated,
6+
; ignore-without-code
7+
plugins =
8+
mypy_django_plugin.main
9+
10+
strict = true
11+
12+
13+
14+
[mypy.plugins.django-stubs]
15+
django_settings_module = demo.settings
16+
17+
[mypy-adminfilters.*]
18+
ignore_errors = true
19+
ignore_missing_imports = True
20+
21+
[mypy-demo.*]
22+
ignore_errors = true
23+
ignore_missing_imports = True
24+
25+
26+
[mypy-demo.models.*]
27+
ignore_errors = true
28+
ignore_missing_imports = True
29+
30+
[mypy-demo.upload.*]
31+
ignore_errors = true
32+
ignore_missing_imports = True

pyproject.toml

Lines changed: 69 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,16 @@ requires = [
99
name = "django-adminfilters"
1010
description = "Collection of Django Admin filters"
1111
readme = "README.md"
12-
requires-python = ">=3.9"
12+
requires-python = ">=3.10"
1313
classifiers = [
1414
"Environment :: Web Environment",
1515
"Framework :: Django",
16-
"Framework :: Django :: 3.2",
1716
"Framework :: Django :: 4.2",
1817
"Framework :: Django :: 5.2",
1918
"Intended Audience :: Developers",
2019
"License :: OSI Approved :: BSD License",
2120
"Operating System :: OS Independent",
2221
"Programming Language :: Python :: 3 :: Only",
23-
"Programming Language :: Python :: 3.9",
2422
"Programming Language :: Python :: 3.10",
2523
"Programming Language :: Python :: 3.11",
2624
"Programming Language :: Python :: 3.12",
@@ -44,6 +42,7 @@ dev = [
4442
"django-environ",
4543
"django-factory-boy",
4644
"django-webtest>=1.9.13",
45+
"djlint>=1.36.4",
4746
"pre-commit",
4847
"psycopg2-binary",
4948
"pyproject-fmt>=2.5.1",
@@ -95,128 +94,70 @@ include = [
9594
[tool.hatch.build.targets.wheel]
9695
packages = [ "src/adminfilters" ]
9796

98-
[tool.ruff]
99-
target-version = "py39"
100-
line-length = 120
101-
exclude = [
102-
"docs",
103-
"manage.py",
104-
"tests",
105-
]
106-
format.preview = true
107-
format.docstring-code-line-length = 120
108-
format.docstring-code-format = true
109-
lint.select = [
110-
"ALL",
111-
]
112-
lint.ignore = [
113-
"ANN401", # Dynamically typed expressions
114-
"COM812",
115-
"CPY", # Missing copyright notice
116-
"D", # docstring
117-
"DOC", # docstring
118-
"E731", # Do not assign a `lambda` expression,
119-
"EM101", # Exception must not use a string literal, assign to variable first
120-
"EM102", # Exception must not use a f-string literal, assign to variable first
121-
"FBT001", # Boolean-typed positional argument in function definition
122-
"FBT002", # Boolean default positional argument in function definition
123-
"N806", # Variable `...` in function should be lowercase
124-
"S308", # Use of `mark_safe` may expose cross-site scripting vulnerabilities
125-
"SLF001", # Private member accessed: `...`
126-
"TRY003", # Avoid specifying long messages outside the exception class
127-
"TRY301", # Abstract `raise` to an inner function
128-
"TRY401", # Redundant exception object included in `logging.exception` call
129-
"UP037", #
130-
]
131-
lint.per-file-ignores."docs/conf.py" = [
132-
"A001", #
133-
"D100", #
134-
"ERA001", #
135-
"INP001", #
136-
]
137-
lint.per-file-ignores."src/admin_sync/version.py" = [
138-
"UP006",
139-
"UP035",
140-
]
141-
lint.per-file-ignores."src/adminfilters/depot/migrations/*" = [
142-
"ALL",
143-
]
144-
lint.per-file-ignores."src/adminfilters/version.py" = [
145-
"ALL",
146-
]
147-
lint.per-file-ignores."tests/**/*.py" = [
148-
"ALL",
149-
]
150-
lint.isort = { known-first-party = [ "adminfilters" ] }
151-
lint.pylint.max-args = 7
152-
lint.pylint.max-branches = 14
153-
lint.pylint.max-nested-blocks = 8
154-
lint.preview = true
155-
156-
[tool.check-wheel-contents]
157-
ignore = "W004"
158-
159-
[tool.pyproject-fmt]
160-
max_supported_python = "3.13"
161-
162-
[tool.pytest.ini_options]
163-
django_find_project = false
164-
pythonpath = [ "./tests/demoapp/", "./src" ]
165-
DJANGO_SETTINGS_MODULE = "demo.settings"
166-
norecursedirs = [ "demo", ".tox" ]
167-
addopts = [
168-
"--selenium",
169-
"--tb=short",
170-
"--capture=no",
171-
"--echo-version=django",
172-
"--echo-attr=django.conf.settings.DATABASES.default.ENGINE",
173-
"--cov=adminfilters",
174-
"--cov-report=html",
175-
"--cov-report=xml",
176-
"--cov-config=tests/.coveragerc",
177-
]
178-
python_files = "tests/test_*.py tests/**/test_*.py src/*.py"
179-
markers = [
180-
"functional: mark a test as functional",
181-
"selenium: selenium test",
182-
"skip: skip test",
183-
]
184-
185-
[tool.coverage]
186-
run.source = [
187-
"adminfilters",
188-
]
189-
run.dynamic_context = "test_function"
190-
run.branch = true
191-
run.parallel = true
192-
run.plugins = [
193-
"covdefaults",
194-
]
195-
report.fail_under = 80
196-
report.show_missing = true
197-
report.exclude_lines = [
198-
"pragma: no cover",
199-
]
200-
html.show_contexts = true
201-
html.skip_covered = false
202-
paths.source = [
203-
"src",
204-
".tox*/*/lib/python*/site-packages",
205-
".tox*/pypy*/site-packages",
206-
".tox*\\*\\Lib\\site-packages",
207-
"*/src",
208-
"*\\src",
209-
]
210-
211-
[tool.mypy]
212-
plugins = "mypy_django_plugin.main"
213-
mypy_path = "tests/demoapp"
214-
[[tool.mypy.overrides]]
215-
module = "environ.*"
216-
ignore_missing_imports = true
217-
218-
[tool.django-stubs]
219-
django_settings_module = "demo.settings"
220-
221-
[tool.uv]
222-
package = true
97+
#[tool.check-wheel-contents]
98+
#ignore = "W004"
99+
#
100+
#[tool.pyproject-fmt]
101+
#max_supported_python = "3.13"
102+
#
103+
#[tool.pytest.ini_options]
104+
#django_find_project = false
105+
#pythonpath = [ "./tests/demoapp/", "./src" ]
106+
#DJANGO_SETTINGS_MODULE = "demo.settings"
107+
#norecursedirs = [ "demo", ".tox" ]
108+
#addopts = [
109+
# "--selenium",
110+
# "--tb=short",
111+
# "--capture=no",
112+
# "--echo-version=django",
113+
# "--echo-attr=django.conf.settings.DATABASES.default.ENGINE",
114+
# "--cov=adminfilters",
115+
# "--cov-report=html",
116+
# "--cov-report=xml",
117+
# "--cov-config=tests/.coveragerc",
118+
#]
119+
#python_files = "tests/test_*.py tests/**/test_*.py src/*.py"
120+
#markers = [
121+
# "functional: mark a test as functional",
122+
# "selenium: selenium test",
123+
# "skip: skip test",
124+
#]
125+
#
126+
#[tool.coverage]
127+
#run.source = [
128+
# "adminfilters",
129+
#]
130+
#run.dynamic_context = "test_function"
131+
#run.branch = true
132+
#run.parallel = true
133+
#run.plugins = [
134+
# "covdefaults",
135+
#]
136+
#report.fail_under = 80
137+
#report.show_missing = true
138+
#report.exclude_lines = [
139+
# "pragma: no cover",
140+
#]
141+
#html.show_contexts = true
142+
#html.skip_covered = false
143+
#paths.source = [
144+
# "src",
145+
# ".tox*/*/lib/python*/site-packages",
146+
# ".tox*/pypy*/site-packages",
147+
# ".tox*\\*\\Lib\\site-packages",
148+
# "*/src",
149+
# "*\\src",
150+
#]
151+
#
152+
#[tool.mypy]
153+
#plugins = "mypy_django_plugin.main"
154+
#mypy_path = "tests/demoapp"
155+
#[[tool.mypy.overrides]]
156+
#module = "environ.*"
157+
#ignore_missing_imports = true
158+
#
159+
#[tool.django-stubs]
160+
#django_settings_module = "demo.settings"
161+
#
162+
#[tool.uv]
163+
#package = true

pytest.ini

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
[pytest]
2+
django_find_project = false
3+
pythonpath = ./tests/demoapp/ ./src
4+
DJANGO_SETTINGS_MODULE = demo.settings
5+
norecursedirs = "demo", ".tox"
6+
addopts =
7+
--tb=short
8+
--capture=no
9+
--echo-version=django
10+
--echo-attr=django.conf.settings.DATABASES.default.ENGINE
11+
--cov=adminfilters
12+
--cov-report=html
13+
--cov-report=xml
14+
--cov-config=tests/.coveragerc
15+
16+
;python_files = "tests/test_*.py tests/**/test_*.py src/*.py"
17+
markers =
18+
functional: mark a test as functional
19+
selenium: selenium test
20+
skip: skip test
21+
22+
;
23+
;[tool.coverage]
24+
;run.source = [
25+
; "admin_sync",
26+
;]
27+
;run.dynamic_context = "test_function"
28+
;run.branch = true
29+
;run.parallel = true
30+
;run.omit = [
31+
; "**/create_extra_permissions.py",
32+
;]
33+
;run.plugins = [
34+
; "covdefaults",
35+
;]
36+
;report.fail_under = 80
37+
;report.show_missing = true
38+
;report.exclude_lines = [
39+
; "pragma: no cover",
40+
;]
41+
;html.show_contexts = true
42+
;html.skip_covered = false
43+
;paths.source = [
44+
; "src",
45+
; ".tox*/*/lib/python*/site-packages",
46+
; ".tox*/pypy*/site-packages",
47+
; ".tox*\\*\\Lib\\site-packages",
48+
; "*/src",
49+
; "*\\src",
50+
;]

0 commit comments

Comments
 (0)