diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d634cbf..3866aa1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ on: # manually triggered jobs: - build: + test: runs-on: ubuntu-latest strategy: matrix: @@ -25,8 +25,54 @@ jobs: 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: | uv venv uv pip install ".[testing]" .venv/bin/pytest tests + + docs: + runs-on: ubuntu-latest + steps: + - 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: Building docs + run: | + uv venv --python 3.11 + uv pip install ".[doc]" + .venv/bin/sphinx-build -a -W -E doc build/sphinx/html + + 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/doc/changelog.rst b/doc/changelog.rst index 2d43185..7c9d79d 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -1,13 +1,11 @@ Changelog ========= -* :feature:`-` Support python versions: >= 3.8, <= 3.13 +* :feature:`-` Use hatchlig as build-backend * :feature:`-` Use UV in CI * :feature:`-` Use `pyproject.toml` from package configuration * :feature:`-` Move CI to GitHub Actions (from Travis CI) -* :feature:`-` Support python version 3.8, 3.9, 3.10, 3.11 -* :feature:`-` Drop support for python versions: 2.7, 3.4, 3.5, 3.6 -* :feature:`-` Support python 3.12 +* :feature:`-` Support python versions >= 3.8 (drop support for older versions) * :release:`0.4.1 <07-05-2018>` * :bug:`-` Set releases version to 3.6 only * :release:`0.4.0 <28-06-2017>` diff --git a/pyproject.toml b/pyproject.toml index 604ec4e..e554ad3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -requires = ["setuptools", "setuptools-scm"] -build-backend = "setuptools.build_meta" +requires = ["hatchling>=0.25.1", "hatch-vcs"] +build-backend = "hatchling.build" [project] name = "vintage" @@ -20,20 +20,14 @@ classifiers = [ dependencies = [] dynamic = ["version"] -authors = [ - { name = "Rotem Yaari", email = "vmalloc@gmail.com" }, -] +authors = [{ name = "Rotem Yaari", email = "vmalloc@gmail.com" }] [project.urls] -"Homepage" = "https://github.com/getslash/vintag" +"Homepage" = "https://github.com/getslash/vintage" [project.optional-dependencies] -testing = [ - "pytest>=2.9", - "pylint>=1.7.2", -] -doc = [ - "Sphinx", - "alabaster", - "releases", -] +testing = ["pytest>=2.9", "pylint>=1.7.2"] +doc = ["Sphinx", "alabaster", "releases"] + +[tool.hatch.version] +source = "vcs"