diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e90249..ca6397c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,25 +53,11 @@ jobs: print(f"Publishing from {ref}, matching project version {version}.") PY - - name: Install build and test dependencies - run: | - python -m pip install --upgrade pip build twine pytest + - name: Install uv + uses: astral-sh/setup-uv@v8.1.0 - name: Build source and wheel distributions - run: | - python -m build - - - name: Check built distributions - run: | - python -m twine check dist/* - - - name: Install package from built wheel - run: | - python -m pip install --force-reinstall dist/*.whl - - - name: Run Python tests - run: | - python -m pytest + run: uv build - name: Upload built distributions uses: actions/upload-artifact@v7 @@ -86,22 +72,35 @@ jobs: needs: build runs-on: ubuntu-latest permissions: + contents: read id-token: write environment: name: testpypi - url: https://test.pypi.org/project/stitchmeta/ steps: + - name: Checkout repository + uses: actions/checkout@v6 + - name: Download built distributions uses: actions/download-artifact@v8 with: name: python-package-distributions path: dist/ + - name: Install uv + uses: astral-sh/setup-uv@v8.1.0 + + - name: Show downloaded files + run: | + pwd + ls -lah + ls -lah dist + - name: Publish distributions to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ + run: | + uv publish --index testpypi \ + --config-file ${{ github.workspace }}/pyproject.toml \ + dist/* publish-pypi: name: Publish to PyPI @@ -109,20 +108,32 @@ jobs: needs: build runs-on: ubuntu-latest permissions: + contents: read id-token: write environment: name: pypi - url: https://pypi.org/project/stitchmeta/ steps: + - name: Checkout repository + uses: actions/checkout@v6 + - name: Download built distributions uses: actions/download-artifact@v8 with: name: python-package-distributions path: dist/ + - name: Install uv + uses: astral-sh/setup-uv@v8.1.0 + + - name: Show downloaded files + run: | + pwd + ls -lah + ls -lah dist + - name: Publish distributions to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + run: uv publish dist/* github-release: name: Create GitHub Release diff --git a/.readthedocs.yml b/.readthedocs.yml index 36ba997..6376592 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-24.04 tools: - python: "3.13" + python: "3.14" sphinx: configuration: doc/conf.py @@ -12,7 +12,8 @@ formats: all python: install: - - method: pip + - method: uv + command: pip path: . - extra_requirements: + extras: - docs diff --git a/pyproject.toml b/pyproject.toml index 1b2e187..a4b4ad7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,3 +65,9 @@ python_version = "3.14" warn_return_any = true warn_unused_configs = true exclude = "doc" + +[[tool.uv.index]] +name = "testpypi" +url = "https://test.pypi.org/stitchmeta/" +publish-url = "https://test.pypi.org/legacy/" +explicit = true