Skip to content

Commit

Permalink
Test setup-uv.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Jun 5, 2024
1 parent 628b00d commit 2a2a5c8
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/lockfile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build == 1.1.1
8 changes: 8 additions & 0 deletions .github/workflows/lockfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was autogenerated by uv via the following command:
# uv pip compile --python-version 3.12 --python-platform linux lockfile.in
build==1.1.1
# via -r lockfile.in
packaging==24.0
# via build
pyproject-hooks==1.1.0
# via build
53 changes: 53 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Test

on:
pull_request:

workflow_dispatch:

push:
branches:
- trunk

jobs:
setup_uv_defaults:
name: setup-uv [default]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.12"
- name: Set up Python environment
uses: ./setup-uv
- run: uv --version

setup_uv_version:
name: setup-uv [version]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.12"
- name: Set up Python environment
uses: ./setup-uv
with:
version: 0.2.2
- run: uv --version

setup_uv_lockfile:
name: setup-uv [lockfile]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.12"
- name: Set up Python environment
uses: ./setup-uv
with:
lockfile: .github/workflows/lockfile.txt
- run: uv --version
- run: python -m build --version

20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ci:
autoupdate_schedule: quarterly
autoupdate_branch: 'trunk'
autofix_prs: false

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v4.5.0'
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-json
- id: check-toml
- id: check-yaml
- id: check-case-conflict
- id: mixed-line-ending
- repo: https://github.com/crate-ci/typos
rev: v1.21.0
hooks:
- id: typos
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ steps:
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: "3.12"
- uses: glotzerlab/workflows/setup-python@<insert hash of tagged version here> # v0.1.0
- name: Set up Python environment
uses: glotzerlab/workflows/setup-python@<insert hash of tagged version here> # v0.1.0
with:
lockfile: "requirements.txt"
```
Expand Down
2 changes: 1 addition & 1 deletion setup-uv/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runs:
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/${{ inputs.version }}/uv-installer.sh | bash
shell: bash

- name: Install
- name: Install
if: ${{ inputs.lockfile != '' }}
run: "uv pip sync -r ${{ inputs.lockfile }} --only-binary :all: --system --reinstall"
shell: bash

0 comments on commit 2a2a5c8

Please sign in to comment.