Skip to content

Commit

Permalink
Don't crash if user has set UV_SYSTEM_PYTHON to true (#116)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
hynek authored Apr 11, 2024
1 parent 0397879 commit 7128288
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 14 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ outputs:

runs:
using: composite

steps:
- uses: actions/setup-python@v5
id: python-baipp
Expand All @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 7128288

Please sign in to comment.