From 79ca2fa858e5fadf7c12044e80d3076999c307dc Mon Sep 17 00:00:00 2001 From: Dries Schaumont <5946712+DriesSchaumont@users.noreply.github.com> Date: Tue, 19 Nov 2024 13:30:02 +0100 Subject: [PATCH] Support python 3.13 (#26) * Support python 3.13 * Update CHANGELOG [ci skip] --- .github/workflows/deploy.yaml | 103 ++++++++++++++++++++++++++++++++++ CHANGELOG.rst | 8 +++ README.md | 8 +-- pyproject.toml | 2 +- setup.cfg | 9 +-- tox.ini | 4 +- 6 files changed, 124 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..0825ae1 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,103 @@ +name: Publish Python 🐍 distribution 📦 to PyPI + +on: + workflow_dispatch: + inputs: + version: + description: 'Release version' + required: true + push: + tags: + - '*' + + +jobs: + build: + name: Build distribution 📦 + if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + env: + SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version && github.event.inputs.version || github.ref_name }} + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.8" + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: >- + Publish Python 🐍 distribution 📦 to PyPI + needs: + - build + runs-on: ubuntu-latest + environment: + name: deployment + url: https://pypi.org/p/viashpy + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + github-release: + name: >- + Sign the Python 🐍 distribution 📦 with Sigstore + and upload them to GitHub Release + needs: + - publish-to-pypi + runs-on: ubuntu-latest + + permissions: + contents: write # IMPORTANT: mandatory for making GitHub Releases + id-token: write # IMPORTANT: mandatory for sigstore + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Sign the dists with Sigstore + uses: sigstore/gh-action-sigstore-python@v3.0.0 + with: + inputs: >- + ./dist/*.tar.gz + ./dist/*.whl + - name: Create GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + run: >- + gh release create + '${{ github.ref_name }}' + --repo '${{ github.repository }}' + --notes "" + - name: Upload artifact signatures to GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + # Upload to GitHub Release using the `gh` CLI. + # `dist/` contains the built packages, and the + # sigstore-produced signatures and certificates. + run: >- + gh release upload + '${{ github.ref_name }}' dist/** diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 09d97ff..8ca32a4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,14 @@ Changelog ********* +0.9.0 (19/07/2024) +================== + +New Functionality +----------------- + +* Add support for python 3.13 (#26) + 0.8.0 (29/07/2024) ================== diff --git a/README.md b/README.md index 2d3ab85..1f604ba 100644 --- a/README.md +++ b/README.md @@ -15,18 +15,18 @@ To run the tests, clone the repository and install the development requirements pip install .[dev] # Do not forget to quote this if you are using zsh ``` -By default, viashpy can tested against different python versions (more specifically 3.7 to 3.11) using `tox`. +By default, viashpy can tested against different python versions (more specifically 3.8 to 3.13) using `tox`. These versions of python must be made available to tox (by adding them to your `PATH` environment variable), for example by installing and enabling them using `pyenv`. Afterwards, running the tests is a matter of executing: ```bash -tox . +tox ``` Alternatively, if you wish to test for the python version installed on your system only, you can choose to only test `-e` parameter. ```bash -# Uses python3.7 -tox -e py3.7 +# Uses python3.8 +tox -e py3.8 ``` # License diff --git a/pyproject.toml b/pyproject.toml index 0429409..d706123 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = 'setuptools.build_meta' write_to = "viashpy/__version__.py" [tool.black] -target-version = ['py39', 'py310', 'py311', 'py312'] +target-version = ['py39', 'py310', 'py311', 'py312', 'py313'] exclude = ''' ( \.egg diff --git a/setup.cfg b/setup.cfg index f925cab..84b73b6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,10 +34,11 @@ classifiers = Topic :: Software Development :: Testing Programming Language :: Python Programming Language :: Python :: 3 - Programming Language :: Python :: 3.5 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - 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 :: 3 :: Only Operating System :: OS Independent License :: OSI Approved :: GNU General Public License v3 (GPLv3) diff --git a/tox.ini b/tox.ini index 8ec8cdc..35a5b7e 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ [tox] envlist = py{38,39}-pytest{62} - py{39,310,311,312}-pytest{70,71,72,73,74,80,81} + py{39,310,311,312}-pytest{70,71,72,73,74,80,81,82,83} flake8 isolated_build = True @@ -16,6 +16,8 @@ deps = pytest74: pytest>=7.4,<7.5 pytest80: pytest>=8.0,<8.1 pytest81: pytest>=8.1,<8.2 + pytest82: pytest>=8.2,<8.3 + pytest83: pytest>=8.3,<8.4 coverage pytest-mock commands =