Skip to content

Commit

Permalink
change index used on getsitepackages
Browse files Browse the repository at this point in the history
* on windows, the first element in the result list is the venv directory, the second is the actual site-packages directory
* on ubuntu/macos, the list only contains one element, so index -1 works for both
  • Loading branch information
PhilippMa committed Jan 14, 2025
1 parent 12076de commit 298b2c5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/build_executable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ jobs:
run: uv pip install pyinstaller

- name: Find site package directory
run: echo "sitepackage_dir=$(python -c "import site; print(site.getsitepackages()[0])")" >> $GITHUB_ENV

- run: python -c "import site; print(site.getsitepackages())"
- run: ls $sitepackage_dir
- run: ls $sitepackage_dir/Lib/site-packages
run: echo "sitepackage_dir=$(python -c "import site; print(site.getsitepackages()[-1])")" >> $GITHUB_ENV
# On ubuntu/macos, getsitepackages returns a list with only one element, on windows a list with two elements is returned where the second is correct.

- name: Build executable
run: uv run pyinstaller --onefile --add-data "$sitepackage_dir/license_expression/data/scancode-licensedb-index.json:./license_expression/data" --add-data "$sitepackage_dir/spdx_tools/spdx/parser/tagvalue/*:./spdx_tools/spdx/parser/tagvalue" src/opossum_lib/cli.py
Expand Down

0 comments on commit 298b2c5

Please sign in to comment.