Skip to content

Commit

Permalink
Use upstream setup-uv with uv python
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat committed Sep 17, 2024
1 parent 3ce64d0 commit 2db40ae
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 28 deletions.
36 changes: 16 additions & 20 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,16 @@ jobs:
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup python hatch
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Add .local/bin to Windows PATH
if: runner.os == 'Windows'
shell: bash
run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH
- name: install hatch
run: uv pip install --system --python 3.12 hatch
- name: Setup python for test ${{ matrix.py }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
allow-prereleases: true
run: uv tool install --python-preference only-managed --python 3.13 hatch
- name: install Python
run: uv python install --python-preference only-managed ${{ matrix.py }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down Expand Up @@ -96,13 +94,10 @@ jobs:
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup python hatch
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: install hatch
run: uv pip install --system --python 3.12 hatch
run: uv tool install --python-preference only-managed --python 3.13 hatch
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down Expand Up @@ -143,13 +138,14 @@ jobs:
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup python hatch
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Add .local/bin to Windows PATH
if: runner.os == 'Windows'
shell: bash
run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH
- name: install hatch
run: uv pip install --system --python 3.12 hatch
run: uv tool install --python-preference only-managed --python 3.13 hatch
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ jobs:
permissions:
id-token: write
steps:
- name: Setup python to build package
uses: actions/setup-python@v5
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
with:
python-version: "3.12"
- name: setup uv for tox
uses: yezz123/setup-uv@v4
- name: Install build
run: uv pip install build[uv] --system
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build package
run: pyproject-build --installer uv --sdist --wheel . --outdir dist
run: uv build --python 3.13 --python-preference only-managed --sdist --wheel . --out-dir dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.10.1
with:
attestations: true

0 comments on commit 2db40ae

Please sign in to comment.