Skip to content

Commit 32cb58f

Browse files
authored
Merge branch 'main' into hatch-pre-matrix
2 parents d68bfa7 + 52dd7ba commit 32cb58f

1 file changed

Lines changed: 13 additions & 22 deletions

File tree

.github/workflows/test.yaml

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
python: ["3.10", "3.12"]
21+
python: ["3.10", "3.13"]
2222
os: [ubuntu-latest]
2323
# one that matches "project-name".lower().replace('-', '_'), one that doesn’t:
2424
package-name: [project_name, package_alt]
@@ -32,44 +32,35 @@ jobs:
3232
run: |
3333
git config --global user.name "scverse-bot"
3434
git config --global user.email "108668866+scverse-bot@users.noreply.github.com"
35-
- name: Set up Python ${{ matrix.python }}
36-
uses: actions/setup-python@v5
35+
- name: Install uv
36+
uses: astral-sh/setup-uv@v5
3737
with:
38-
python-version: ${{ matrix.python }}
39-
cache: "pip"
40-
cache-dependency-path: "{{cookiecutter.project_name}}/pyproject.toml"
38+
cache-dependency-glob: "{{cookiecutter.project_name}}/pyproject.toml"
4139
- name: Install Ubuntu system dependencies
4240
if: matrix.os == 'ubuntu-latest'
4341
run: sudo apt-get install pandoc
4442
- name: Install build & check dependencies
45-
run: python -m pip install --upgrade pip wheel cookiecutter pre-commit hatch
43+
run: |
44+
uv tool install pre-commit --with=pre-commit-uv
45+
uv tool install cruft --with=pre-commit-uv
46+
uv tool install hatch
4647
# Build
4748
- name: Build from template
48-
shell: python
49-
run: |
50-
from cookiecutter.main import cookiecutter
51-
overrides = dict(package_name='${{ matrix.package-name }}')
52-
cookiecutter('.', no_input=True, extra_context=overrides)
49+
run: cruft create . --no-input --extra-context='{"package_name":"${{ matrix.package-name }}"}'
5350
# Check
54-
- name: Set up pre-commit cache
55-
uses: actions/cache@v4
56-
with:
57-
path: ~/.cache/pre-commit
58-
key: pre-commit-3|${{ matrix.python }}|${{ hashFiles(format('{0}/.pre-commit-config.yaml', env.PROJECT_ROOT)) }}
5951
- name: Run pre-commit
6052
run: |
6153
cd "$PROJECT_ROOT"
6254
git add .
6355
pre-commit run --verbose --color=always --show-diff-on-failure --all-files
64-
- name: Install the package
56+
- name: Install the package and check if it can be imported
6557
run: |
66-
cd $PROJECT_ROOT
67-
pip install .
68-
python -c "import ${{ matrix.package-name }}"
58+
cd "$PROJECT_ROOT"
59+
uv run python -c "import ${{ matrix.package-name }}"
6960
# Docs
7061
- name: Build the documentation
7162
run: |
72-
cd $PROJECT_ROOT
63+
cd "$PROJECT_ROOT"
7364
hatch run docs:build -W
7465
7566
test-scripts:

0 commit comments

Comments
 (0)