From 298b2c59602abe71bb6e80d0a15a586bb9e66b4e Mon Sep 17 00:00:00 2001 From: Philipp Martens Date: Tue, 14 Jan 2025 12:02:48 +0100 Subject: [PATCH] change index used on getsitepackages * 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 --- .github/workflows/build_executable.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_executable.yml b/.github/workflows/build_executable.yml index 2862361..d16e8c4 100644 --- a/.github/workflows/build_executable.yml +++ b/.github/workflows/build_executable.yml @@ -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