diff --git a/.github/workflows/python-pr.yaml b/.github/workflows/python-pr.yaml index cfdb136..0df1971 100644 --- a/.github/workflows/python-pr.yaml +++ b/.github/workflows/python-pr.yaml @@ -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 @@ -17,6 +17,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true - name: Install dependencies run: | diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml index 595fd5e..eac84ce 100644 --- a/.github/workflows/python-publish.yaml +++ b/.github/workflows/python-publish.yaml @@ -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 diff --git a/.github/workflows/python-tox.yaml b/.github/workflows/python-tox.yaml index 8de8051..5fae81c 100644 --- a/.github/workflows/python-tox.yaml +++ b/.github/workflows/python-tox.yaml @@ -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 @@ -24,6 +24,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true - name: Install dependencies run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 545eba2..1c0997c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ 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 @@ -8,26 +8,25 @@ repos: - 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$' diff --git a/HISTORY.md b/HISTORY.md index fe99de8..40366b5 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,9 @@ History ======= + +- Add support for Python 3.13. +- Drop support for Python 3.7. + 0.2.0 (19.02.2024) ------------------ diff --git a/pyproject.toml b/pyproject.toml index 5b6f393..a57e124 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,6 +4,7 @@ build-backend = "setuptools.build_meta" [tool.mypy] strict = true +python_version = 3.8 [[tool.mypy.overrides]] module = "tests" @@ -18,14 +19,16 @@ 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 = @@ -33,20 +36,20 @@ deps = 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/ diff --git a/setup.cfg b/setup.cfg index 9e34eb9..a254acb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -12,7 +12,16 @@ 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 @@ -20,7 +29,7 @@ include_package_data = True package_dir= =src packages = find: -python_requires = >=3.7 +python_requires = >=3.8 install_requires = xsdata diff --git a/tests/test_ech_0252_2_majorz_information.py b/tests/test_ech_0252_2_majorz_information.py index e20b1c4..72141a4 100644 --- a/tests/test_ech_0252_2_majorz_information.py +++ b/tests/test_ech_0252_2_majorz_information.py @@ -25,8 +25,8 @@ SubtotalInfo = CountOfVotersInformationType.SubtotalInfo ElectionGroup = ElectionGroupInfoType.ElectionGroup ElectionInformation = ElectionGroup.ElectionInformation -ElectionDescriptionInfo = \ - ElectionDescriptionInformationType.ElectionDescriptionInfo +ElectionDescriptionInfo = ( + ElectionDescriptionInformationType.ElectionDescriptionInfo) @fixture() diff --git a/tests/test_ech_0252_2_proporz_information.py b/tests/test_ech_0252_2_proporz_information.py index c0b3ccc..856bb0f 100644 --- a/tests/test_ech_0252_2_proporz_information.py +++ b/tests/test_ech_0252_2_proporz_information.py @@ -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