Skip to content

Commit

Permalink
Add support for Python 3.12 and Django 5.0, drop support for Python 3.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
tolomea committed Feb 3, 2024
1 parent 7706897 commit 9bb0af2
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
database_url:
- sqlite:///db.sqlite3
- mysql://root:test@127.0.0.1:3306/data_browser
Expand Down
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Supported Versions

The Data Browser is currently tested on:

* Django 3.2 - 4.2
* Python 3.7 - 3.11
* Django 3.2 - 5.0
* Python 3.8 - 3.12
* MySQL, PostgreSQL, SQLite

We highly recommend and only officially support the latest patch release of each Python and Django series.
Expand Down Expand Up @@ -470,6 +470,7 @@ Release History
| | | | Support custom admin sites. Contributed by #aboutofpluto |
| | | | Fix date expression in a filter on a datetime field not anchoring to midnight. |
| | | | Use verbose names for apps and models. |
| | | | Add support for Python 3.12 and Django 5.0, drop support for Python 3.7. |
+---------+------------+----------------------------------------------------------------------------------------------------------+
| 4.2.5 | 2023-07-20 | | Fix parsing of date/datetime strings like ``mon-1``. |
| | | | Add support for DB query analyze via ``.analyze`` url, similar to the existing ``.explain``. |
Expand Down
9 changes: 4 additions & 5 deletions data_browser/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,10 @@ def _parse(cls, value, choices):
kwargs = {"weekday": arg(-val)}

res += relativedelta.relativedelta(**kwargs)
elif cls._unambiguous_date_parse(clause_str, default=cls._truncate_dt(res)):
# TODO could walrus the duplicate call once we drop support for py3.7
res = cls._unambiguous_date_parse(
clause_str, default=cls._truncate_dt(res)
)
elif parsed := cls._unambiguous_date_parse(
clause_str, default=cls._truncate_dt(res)
):
res = parsed
else:
raise Exception(f"Unrecognized clause '{clause_str}'")

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
skip_empty = true

[tool.flake8]
target-version = "3.7"
target-version = "3.8"
extend-ignore = [
# Loop control variable not used within the loop body TODO enable this
"B007",
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# package requirements
dataclasses; python_version<"3.7"
dataclasses; python_version<"3.8"
Django>=2.2
hyperlink
python-dateutil
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires=">=3.7",
python_requires=">=3.8",
package_data={"": data_files},
install_requires=["Django>=3.2", "hyperlink", "python-dateutil", "sqlparse"],
)
12 changes: 7 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[tox]
envlist =
py37-django{32}
py38-django{32,40,41,42}
py39-django{32,40,41,42}
py310-django{32,40,41,42}
py311-django{41,42}
py310-django{32,40,41,42,50}
py311-django{41,42,50}
py312-django{42,50}

[testenv]
passenv = DATABASE_URL
Expand All @@ -21,8 +22,9 @@ deps =
django32: Django>=3.2,<3.3
django40: Django>=4.0,<4.1
django41: Django>=4.1,<4.2
django42: Django>=4.2a1,<4.3
django42: Django>=4.2,<4.3
django59: Django>=5.0,<5.1
commands =
- pip install mysqlclient
django{32,40,41,42}: - pip install psycopg2
- pip install psycopg2
python -m coverage run -m pytest --create-db

0 comments on commit 9bb0af2

Please sign in to comment.