Skip to content

Commit

Permalink
Add tests and classifiers for 3.11 and 3.12
Browse files Browse the repository at this point in the history
- Add 3.11 and 3.12 to tox and GHA
- Run linting in separate GHA job
- defusedxml is now mature
  • Loading branch information
tiran committed Sep 26, 2023
1 parent 4e6cea5 commit fc47fc2
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 17 deletions.
40 changes: 34 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
name: CI

permissions:
contents: read

on:
push:
branches:
Expand All @@ -9,31 +15,53 @@ on:
- master
- main
- v*.x
schedule:
# every Monday
- cron: '30 4 * * 1'
workflow_dispatch:

jobs:
tests:
name: "Python ${{ matrix.python-version }}"
runs-on: "ubuntu-20.04"
name: "Python ${{ matrix.python-version }} on ${{ matrix.image }}"
runs-on: "${{ matrix.image }}"
strategy:
fail-fast: false
matrix:
python-version:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11-dev"
- "3.11"
- "3.12"
image:
- "ubuntu-22.04"
include:
- python-version: "3.6"
image: "ubuntu-20.04"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v4"
with:
python-version: "${{ matrix.python-version }}"
allow-prereleases: true
- name: "Update pip"
run: python -m pip install --upgrade pip setuptools wheel
- name: "Install tox dependencies"
run: python -m pip install --upgrade tox tox-gh-actions
- name: "Run tox for ${{ matrix.python-version }}"
run: "python -m tox"

lint:
name: "Linting"
runs-on: "ubuntu-22.04"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v4"
with:
python-version: "3.11"
- name: "Update pip"
run: python -m pip install --upgrade pip setuptools wheel
- name: "Install tox dependencies"
run: python -m pip install --upgrade tox
- name: "Run tox for lint"
run: "python -m tox -e black,doc,pep8py3"
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build and upload to PyPI
name: "Build for PyPI (optionally: upload)"

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defusedxml 0.8.0.dev1
---------------------

- Drop support for Python 2.7, 3.4, and 3.5.
- Officially support Python 3.10, 3.11, 3.12. (0.7 works fine, too.)
- Test on 3.10, 3.11, and 3.12.
- Add ``defusedxml.ElementTree.fromstringlist()``
- Fix regression ``defusedxml.ElementTree.ParseError`` (#63)
The ``ParseError`` exception is now the same class object as
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def run(self):
long_description="\n".join(long_description),
long_description_content_type="text/x-rst",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Development Status :: 6 - Mature",
"Intended Audience :: Developers",
"License :: OSI Approved :: Python Software Foundation License",
"Natural Language :: English",
Expand All @@ -59,6 +59,7 @@ def run(self):
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Text Processing :: Markup :: XML",
],
python_requires=">=3.6",
Expand Down
14 changes: 6 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py36,py37,py38,py39,py310,py311,black,pep8py3,doc
envlist = py36,py37,py38,py39,py310,py311,py312,black,pep8py3,doc
skip_missing_interpreters = true

[testenv]
Expand All @@ -8,10 +8,6 @@ commands =
deps =
lxml

[testenv:py38]
# lxml FTBFS because Python sets -Wimplicit-int
deps =

[testenv:black]
commands = black --check --verbose \
{toxinidir}/setup.py \
Expand Down Expand Up @@ -47,6 +43,8 @@ max-line-length = 98
python =
3.6: py36
3.7: py37
3.8: py38, pep8py3
3.9: py39, doc
3.10: py310, black
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312

0 comments on commit fc47fc2

Please sign in to comment.