From 7037df574cd20369d7e64385bafd785cfcb82ad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Tue, 17 Sep 2024 09:52:38 -0700 Subject: [PATCH] Use upstream setup-uv with uv python MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernát Gábor --- .github/workflows/check.yml | 41 ++++++++++++++++++----------------- .github/workflows/release.yml | 15 ++++++------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 5e02305..11ecdbf 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -38,17 +38,14 @@ jobs: with: enable-cache: true 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 ${{ matrix.py }} - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -97,12 +94,14 @@ jobs: with: enable-cache: true 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 + - name: install Python + run: uv python install 3.13 - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -144,12 +143,14 @@ jobs: with: enable-cache: true 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 + - name: install Python + run: uv python install 3.13 - uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5a1e8ed..3abdd5d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,18 +12,17 @@ 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 + 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