Skip to content

Commit

Permalink
chore(ci): switch to uv fully
Browse files Browse the repository at this point in the history
We were still using the actions/setup-python action, which does not
properly support uv. We switch instead to `astral-sh/setup-uv` and use
uv to manage Python version as well.

Signed-off-by: JP-Ellis <[email protected]>
  • Loading branch information
JP-Ellis committed Oct 9, 2024
1 parent 4493567 commit 4e226a2
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 48 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,18 @@ jobs:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
uses: astral-sh/setup-[email protected]
with:
python-version: ${{ env.STABLE_PYTHON_VERSION }}
cache: pip
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
- name: Install Python
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}

- name: Install hatch
run: pip install --upgrade hatch
run: uv tool install hatch

- name: Create source distribution
run: |
Expand Down Expand Up @@ -231,10 +236,19 @@ jobs:
path: wheels
merge-multiple: true

- name: Setup Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
- name: Set up uv
uses: astral-sh/setup-[email protected]
with:
python-version: ${{ env.STABLE_PYTHON_VERSION }}
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
- name: Install Python
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}

- name: Install commitizen
run: uv tool install commitizen

- name: Update changelog
id: changelog
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,19 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
- name: Set up uv
uses: astral-sh/setup-[email protected]
with:
python-version: ${{ env.STABLE_PYTHON_VERSION }}
cache: pip
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
- name: Install Python
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}

- name: Install Hatch
run: pip install --upgrade hatch
run: uv tool install hatch

- name: Build docs
run: |
Expand Down
102 changes: 66 additions & 36 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,19 @@ jobs:
cd tests/v3/compatibility_suite
patch -p1 -d definition < definition-update.diff
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
- name: Set up uv
uses: astral-sh/setup-[email protected]
with:
python-version: ${{ matrix.python-version }}
cache: pip
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
- name: Install Python
run: uv python install ${{ matrix.python-version }}

- name: Install Hatch
run: pip install --upgrade hatch
run: uv tool install hatch

- name: Ensure broker is live
run: |
Expand Down Expand Up @@ -152,14 +157,19 @@ jobs:
cd tests/v3/compatibility_suite
patch -p1 -d definition < definition-update.diff
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
- name: Set up uv
uses: astral-sh/setup-[email protected]
with:
python-version: ${{ matrix.python-version }}
cache: pip
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
- name: Install Python
run: uv python install ${{ matrix.python-version }}

- name: Install Hatch
run: pip install --upgrade hatch
run: uv tool install hatch

- name: Run tests
run: hatch run test
Expand All @@ -186,14 +196,19 @@ jobs:
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4

- name: Set up Python 3
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
- name: Set up uv
uses: astral-sh/setup-[email protected]
with:
python-version: ${{ env.STABLE_PYTHON_VERSION }}
cache: pip
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
- name: Install Python
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}

- name: Install Hatch
run: pip install --upgrade hatch
run: uv tool install hatch

- name: Ensure broker is live
run: |
Expand Down Expand Up @@ -225,14 +240,19 @@ jobs:
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4

- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
- name: Set up uv
uses: astral-sh/setup-[email protected]
with:
python-version: ${{ env.STABLE_PYTHON_VERSION }}
cache: pip
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
- name: Install Python
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}

- name: Install Hatch
run: pip install --upgrade hatch
run: uv tool install hatch

- name: Format
run: hatch run format
Expand All @@ -245,14 +265,19 @@ jobs:
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4

- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
- name: Set up uv
uses: astral-sh/setup-[email protected]
with:
python-version: ${{ env.STABLE_PYTHON_VERSION }}
cache: pip
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
- name: Install Python
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}

- name: Install Hatch
run: pip install --upgrade hatch
run: uv tool install hatch

- name: Format
run: hatch run lint
Expand All @@ -265,14 +290,19 @@ jobs:
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4

- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
- name: Set up uv
uses: astral-sh/setup-[email protected]
with:
python-version: ${{ env.STABLE_PYTHON_VERSION }}
cache: pip
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
- name: Install Python
run: uv python install ${{ env.STABLE_PYTHON_VERSION }}

- name: Install Hatch
run: pip install --upgrade hatch
run: uv tool install hatch

- name: Format
run: hatch run typecheck
Expand All @@ -283,18 +313,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4

- name: Spell Check Repo
uses: crate-ci/typos@master
- name: Spell Check Repo
uses: crate-ci/typos@master

pre-commit:
name: Pre-commit

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4

- name: Run pre-commit
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
- name: Run pre-commit
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

0 comments on commit 4e226a2

Please sign in to comment.