From 239237f5ad9c12810dc02986f17aa73763618124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez-Mondrag=C3=B3n?= Date: Thu, 3 Oct 2024 23:20:06 -0600 Subject: [PATCH] Use uv in the project CI --- .../workflows/build.yml.jinja | 2 +- .../workflows/test.yml.jinja | 29 ++++++------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/src/[% if repository_provider == 'github.com' %].github[% endif %]/workflows/build.yml.jinja b/src/[% if repository_provider == 'github.com' %].github[% endif %]/workflows/build.yml.jinja index dc7b5b5..5bcba76 100644 --- a/src/[% if repository_provider == 'github.com' %].github[% endif %]/workflows/build.yml.jinja +++ b/src/[% if repository_provider == 'github.com' %].github[% endif %]/workflows/build.yml.jinja @@ -37,6 +37,6 @@ jobs: tag: ${{ github.ref }} overwrite: true file_glob: true - - uses: pypa/gh-action-pypi-publish@v1.10.1 + - uses: pypa/gh-action-pypi-publish@v1.10.3 with: attestations: true diff --git a/src/[% if repository_provider == 'github.com' %].github[% endif %]/workflows/test.yml.jinja b/src/[% if repository_provider == 'github.com' %].github[% endif %]/workflows/test.yml.jinja index 1bcb65a..49ac460 100644 --- a/src/[% if repository_provider == 'github.com' %].github[% endif %]/workflows/test.yml.jinja +++ b/src/[% if repository_provider == 'github.com' %].github[% endif %]/workflows/test.yml.jinja @@ -55,39 +55,28 @@ jobs: - "3.12" - "3.13" include: - - { script: "test:dependencies", python-version: "3.12" } - - { script: "typing:check", python-version: "3.12" } + - { script: "test:dependencies", python-version: "3.x" } + - { script: "typing:check", python-version: "3.x" } steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 + id: setup-python with: python-version: ${{ matrix.python-version }} allow-prereleases: true - cache: pip - - - name: Upgrade pip - run: | - pip install pip - pip --version - - - name: Upgrade pip in virtual environments - shell: python - run: | - import os - import pip - - with open(os.environ["GITHUB_ENV"], mode="a") as io: - print(f"VIRTUALENV_PIP={pip.__version__}", file=io) + - uses: astral-sh/setup-uv@v3 + with: + version: ">=0.4.18" - name: Install Hatch run: | - pipx install hatch + uv tool install hatch hatch --version - name: Run tests env: - HATCH_PYTHON: ${{ matrix.python-version }} + HATCH_PYTHON: ${{ steps.setup-python.outputs.python-path }} HATCH_VERBOSE: "1" [%- for env in passenv %] [[ env ]]: ${{ secrets.[[ env ]] }} @@ -107,6 +96,6 @@ jobs: with: python-version: "3.x" - uses: pre-commit/action@v3.0.1 - - uses: pre-commit-ci/lite-action@v1.0.2 + - uses: pre-commit-ci/lite-action@v1.0.3 if: always() [%- endif %]