diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7e6a45b..248f1e4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,22 +7,58 @@ on: # manually triggered jobs: - build: - + test: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + env: + UV_PYTHON: ${{ matrix.python-version }} steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} + - name: Checkout the repository + uses: actions/checkout@main + - name: Install the default version of uv + id: setup-uv + uses: astral-sh/setup-uv@v3 + - name: Print the installed version + run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}" + - name: Install Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} + - name: Tests run: | - python -m venv .env - .env/bin/pip install -U setuptools pip - .env/bin/pip install '.[testing]' - .env/bin/pytest tests + uv venv + uv pip install ".[testing]" + .venv/bin/pytest tests + + publish: + if: startsWith(github.ref, 'refs/tags/') + needs: test + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install hatch + run: pip install hatch + + - name: Build package + run: hatch build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + attestations: true + skip-existing: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 64c7284..c3c5ae4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ Slash-Step ChangeLog Next Version ------------ +* Update supported python version: add 3.13 +* Publish to PyPi through CI +* Remove code compatibility for unsupported python versions + Version 1.2.0 (Released 2021-09-07) ----------------------------------- * Update supported python version: add 3.12 & remove 3.7 diff --git a/pyproject.toml b/pyproject.toml index 7070835..5ee63d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,28 +15,27 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] dependencies = [ "Logbook>=1.2.0", "gossip", "slash>=0.7.0", + # Slash still using pkg_resources, installing setuptools as temporary workaround + # so this repo can be installed with UV + # Should be removed once a new version of slash will be released. + "setuptools<81", ] dynamic = ["version"] -authors = [ - { name = "Omer Gertel", email = "omer.gertel@gmail.com" }, -] +authors = [{ name = "Omer Gertel", email = "omer.gertel@gmail.com" }] [project.urls] "Homepage" = "https://github.com/getslash/slash-step" [project.optional-dependencies] -testing = [ - "pytest", - "pylint", - "munch", -] +testing = ["pytest", "pylint", "munch"] [tool.hatch.version] source = "vcs" diff --git a/slash_step/__version__.py b/slash_step/__version__.py index b4c0037..2310f70 100644 --- a/slash_step/__version__.py +++ b/slash_step/__version__.py @@ -1,3 +1,3 @@ -from ._compat import get_distribution +from importlib.metadata import distribution -__version__ = get_distribution("slash-step").version +__version__ = distribution("slash-step").version diff --git a/slash_step/_compat.py b/slash_step/_compat.py deleted file mode 100644 index c33c1e5..0000000 --- a/slash_step/_compat.py +++ /dev/null @@ -1,14 +0,0 @@ -import sys - -if sys.version_info < (3, 8): - # pylint: disable=unused-import - import pkg_resources - - get_distribution = pkg_resources.get_distribution - PackageNotFoundError = pkg_resources.DistributionNotFound -else: - # pylint: disable=unused-import - import importlib.metadata - - get_distribution = importlib.metadata.distribution - PackageNotFoundError = importlib.metadata.PackageNotFoundError