Skip to content

Commit 35515d1

Browse files
committed
chore: modernize CI, python and django compatibility
- Make compatible with all LTS django versions after and including 2.2, and python versions 3.8 through 3.13 - update the github actions test matrix for new python and django versions - Move project metadata from setup.py to pyproject.toml - Reformat code with ruff - Reorganize djxml.fields imports
1 parent 293bd1e commit 35515d1

36 files changed

+1404
-1361
lines changed

.github/workflows/test.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,33 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: [3.7, 3.8]
10+
python-version: ["3.11"]
11+
django-version: ["4.2"]
12+
include:
13+
- python-version: "3.8"
14+
django-version: "2.2"
15+
- python-version: "3.9"
16+
django-version: "3.2"
17+
- python-version: "3.10"
18+
django-version: "4.2"
19+
- python-version: "3.11"
20+
django-version: "5.1"
21+
- python-version: "3.13"
22+
django-version: "5.2"
23+
24+
name: Django ${{ matrix.django-version }} (Python ${{ matrix.python-version }})
25+
26+
env:
27+
DJANGO: ${{ matrix.django-version }}
1128

1229
steps:
13-
- uses: actions/checkout@v1
30+
- uses: actions/checkout@v4
1431
- name: Set up Python ${{ matrix.python-version }}
15-
uses: actions/setup-python@v2
32+
uses: actions/setup-python@v5
1633
with:
1734
python-version: ${{ matrix.python-version }}
1835
- name: Install dependencies
1936
run: |
20-
python -m pip install --upgrade pip
21-
pip install tox tox-gh-actions
37+
python3 -mpip install tox tox-gh-actions
2238
- name: Test with tox
23-
run: tox
39+
run: tox -- -vvv

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ pip-log.txt
1313
.tox
1414
/venv
1515
.python-version
16+
.coverage

MANIFEST.in

Lines changed: 0 additions & 3 deletions
This file was deleted.

djxml/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.0.1"
1+
__version__ = "4.0.0"

djxml/build/__init__.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

djxml/build/rst_converter.py

Lines changed: 0 additions & 105 deletions
This file was deleted.

djxml/tests/settings.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

djxml/xmlmodels/__init__.py

Lines changed: 71 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,71 @@
1-
from .loading import (get_apps, get_app, get_xml_models, get_xml_model, # noqa
2-
register_xml_models,)
3-
from . import signals # noqa
4-
from .base import XmlModel # noqa
5-
from .decorators import lxml_extension # noqa
6-
from .fields import (XmlElementField, XmlPrimaryElementField, # noqa
7-
XPathSingleNodeField, XPathTextField, XPathIntegerField,
8-
XPathFloatField, XPathDateTimeField, XPathListField,
9-
XPathTextListField, XPathIntegerListField,
10-
XPathFloatListField, XPathDateTimeListField, XsltField,
11-
XPathHtmlField, XPathHtmlListField,
12-
XPathInnerHtmlField, XPathInnerHtmlListField,
13-
XPathBooleanField, XPathBooleanListField, SchematronField,)
14-
from .related import (EmbeddedXPathField, EmbeddedXPathListField, # noqa
15-
EmbeddedXsltField, EmbeddedSchematronField,)
1+
__all__ = (
2+
"get_apps",
3+
"get_app",
4+
"get_xml_models",
5+
"get_xml_model",
6+
"register_xml_models",
7+
"signals",
8+
"XmlModel",
9+
"lxml_extension",
10+
"XmlElementField",
11+
"XmlPrimaryElementField",
12+
"XPathSingleNodeField",
13+
"XPathTextField",
14+
"XPathIntegerField",
15+
"XPathFloatField",
16+
"XPathDateTimeField",
17+
"XPathListField",
18+
"XPathTextListField",
19+
"XPathIntegerListField",
20+
"XPathFloatListField",
21+
"XPathDateTimeListField",
22+
"XsltField",
23+
"XPathHtmlField",
24+
"XPathHtmlListField",
25+
"XPathInnerHtmlField",
26+
"XPathInnerHtmlListField",
27+
"XPathBooleanField",
28+
"XPathBooleanListField",
29+
"SchematronField",
30+
"EmbeddedXPathField",
31+
"EmbeddedXPathListField",
32+
"EmbeddedXsltField",
33+
"EmbeddedSchematronField",
34+
)
35+
36+
from .loading import (
37+
get_apps,
38+
get_app,
39+
get_xml_models,
40+
get_xml_model,
41+
register_xml_models,
42+
)
43+
from . import signals
44+
from .base import XmlModel
45+
from .decorators import lxml_extension
46+
from .fields import (
47+
XmlElementField,
48+
XmlPrimaryElementField,
49+
XPathSingleNodeField,
50+
XPathTextField,
51+
XPathIntegerField,
52+
XPathFloatField,
53+
XPathDateTimeField,
54+
XPathListField,
55+
XPathTextListField,
56+
XPathIntegerListField,
57+
XPathFloatListField,
58+
XPathDateTimeListField,
59+
XsltField,
60+
XPathHtmlField,
61+
XPathHtmlListField,
62+
XPathInnerHtmlField,
63+
XPathInnerHtmlListField,
64+
XPathBooleanField,
65+
XPathBooleanListField,
66+
SchematronField,
67+
EmbeddedXPathField,
68+
EmbeddedXPathListField,
69+
EmbeddedXsltField,
70+
EmbeddedSchematronField,
71+
)

0 commit comments

Comments
 (0)