From 71282886fd5cfa1d0cf1df42ac56b454964da848 Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Thu, 11 Apr 2024 13:47:25 -0700 Subject: [PATCH] Don't crash if user has set UV_SYSTEM_PYTHON to true (#116) * Don't crash if user has set UV_SYSTEM_PYTHON to true * Try to set env within * wtf * Try passing argument!? * Use unset instead * Remove extra empty line --- .github/workflows/ci.yml | 1 + action.yml | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e3ccd1..72a8c6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ on: env: FORCE_COLOR: "1" # Make tools pretty. SETUPTOOLS_SCM_PRETEND_VERSION: "1.0" # avoid warnings about shallow checkout + UV_SYSTEM_PYTHON: "true" # ensure action can deal with this set jobs: check-argon2-cffi-bindings: diff --git a/action.yml b/action.yml index acb1e0c..b682a62 100644 --- a/action.yml +++ b/action.yml @@ -40,6 +40,7 @@ outputs: runs: using: composite + steps: - uses: actions/setup-python@v5 id: python-baipp @@ -65,16 +66,20 @@ runs: key: baipp-${{ env.REQS_HASH }} - name: Create venv for tools - run: > - uv venv - /tmp/baipp - --python ${{ steps.python-baipp.outputs.python-path }} + run: | + unset UV_SYSTEM_PYTHON + + uv venv \ + /tmp/baipp \ + --python ${{ steps.python-baipp.outputs.python-path }} shell: bash - name: Install our tools - run: > - uv pip sync - ${{ github.action_path }}/requirements/tools.txt + run: | + unset UV_SYSTEM_PYTHON + + uv pip sync \ + ${{ github.action_path }}/requirements/tools.txt shell: bash env: VIRTUAL_ENV: /tmp/baipp @@ -84,6 +89,8 @@ runs: # reproducibility. - name: Build package run: | + unset UV_SYSTEM_PYTHON + echo Setting SOURCE_DATE_EPOCH to $(git log -1 --pretty=%ci). export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)