Skip to content

Commit

Permalink
Adds Python 3.13 support. Drops Python 3.7 support.
Browse files Browse the repository at this point in the history
Switches to trusted publishers for publishing workflow.
  • Loading branch information
Daverball committed Aug 21, 2024
1 parent 94df52a commit 262c728
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 29 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/python-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, '3.10', 3.11, 3.12]
python-version: [3.8, 3.9, '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4
Expand All @@ -17,6 +17,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Install dependencies
run: |
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/python-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,28 @@ jobs:

runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/project/xsdata-ech

permissions:
id-token: write

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
pip install build
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build -s -w
twine upload dist/*
- name: Build package distributions
run: python -m build -s -w

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
3 changes: 2 additions & 1 deletion .github/workflows/python-tox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, '3.10', 3.11, 3.12]
python-version: [3.8, 3.9, '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4
Expand All @@ -24,6 +24,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Install dependencies
run: |
Expand Down
11 changes: 5 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
- id: check-merge-conflict
- id: check-ast
- id: debug-statements
- repo: https://github.com/seantis/pre-commit-hooks
rev: v1.0.1
rev: v1.1.0
hooks:
- id: nocheckin
exclude: .pre-commit-config.yaml
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.1.1
hooks:
- id: flake8
files: '^(src/.*|tests/.*)\.py$'
additional_dependencies:
- flake8-bugbear
- flake8-pyi
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
rev: 1.7.9
hooks:
- id: bandit
args: ["-c", "pyproject.toml", "--quiet"]
additional_dependencies: [ "bandit[toml]" ]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
rev: v1.11.1
hooks:
- id: mypy
files: '^(src/.*|tests/.*)\.py$'
Expand Down
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
History
=======

- Add support for Python 3.13.
- Drop support for Python 3.7.

0.2.0 (19.02.2024)
------------------

Expand Down
15 changes: 9 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ build-backend = "setuptools.build_meta"

[tool.mypy]
strict = true
python_version = 3.8

[[tool.mypy.overrides]]
module = "tests"
Expand All @@ -18,35 +19,37 @@ exclude_dirs = [
legacy_tox_ini = """
[tox]
isolated_build = True
envlist = py37,py38,py39,py310,lint,bandit,mypy
envlist = py38,py39,py310,py311,py312,py313,lint,bandit,mypy
[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310,lint,bandit,mypy
3.10: py310
3.11: py311,lint,bandit,mypy
3.12: py312
3.13: py313
[testenv]
deps =
pytest>=2.8.0
commands = py.test
[testenv:lint]
basepython = python3.10
basepython = python3.11
deps =
flake8
commands = flake8 src/ tests/
[testenv:mypy]
basepython = python3.10
basepython = python3.11
deps =
mypy
pytest>=7
commands = mypy src tests
[testenv:bandit]
basepython = python3.10
basepython = python3.11
deps =
bandit[toml]
commands = bandit -c pyproject.toml -r src/
Expand Down
13 changes: 11 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,24 @@ project_urls =
Bug Tracker = https://github.com/seantis/xsdata-ech/issues
classifiers =
Development Status :: 4 - Beta
Programming Language :: Python :: 3
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: Implementation :: CPython
License :: OSI Approved :: MIT License

[options]
zip_safe = False
include_package_data = True
package_dir=
=src
packages = find:
python_requires = >=3.7
python_requires = >=3.8
install_requires =
xsdata

Expand Down
4 changes: 2 additions & 2 deletions tests/test_ech_0252_2_majorz_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
SubtotalInfo = CountOfVotersInformationType.SubtotalInfo
ElectionGroup = ElectionGroupInfoType.ElectionGroup
ElectionInformation = ElectionGroup.ElectionInformation
ElectionDescriptionInfo = \
ElectionDescriptionInformationType.ElectionDescriptionInfo
ElectionDescriptionInfo = (
ElectionDescriptionInformationType.ElectionDescriptionInfo)


@fixture()
Expand Down
4 changes: 2 additions & 2 deletions tests/test_ech_0252_2_proporz_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
SubtotalInfo = CountOfVotersInformationType.SubtotalInfo
ElectionGroup = ElectionGroupInfoType.ElectionGroup
ElectionInformation = ElectionGroup.ElectionInformation
ElectionDescriptionInfo = \
ElectionDescriptionInformationType.ElectionDescriptionInfo
ElectionDescriptionInfo = (
ElectionDescriptionInformationType.ElectionDescriptionInfo)
PartyAffiliationInfo = PartyAffiliationInformationType.PartyAffiliationInfo
ListDescriptionInfo = ListDescriptionInformationType.ListDescriptionInfo
CandidateTextInfo = CandidateTextInformationType.CandidateTextInfo
Expand Down

0 comments on commit 262c728

Please sign in to comment.