Skip to content

Commit

Permalink
[skip ci] BUG: Attempt at inline python script didn't work so well
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpa committed Feb 18, 2024
1 parent 5b6d69b commit f90e610
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ jobs:

- name: Find installed package path
id: find_package_path
run: >
echo "PACKAGE_PATH=$(python -c 'import importlib.util;
package_name=\"ants\"; package_spec=importlib.util.find_spec(package_name);
print(package_spec.submodule_search_locations[0] if package_spec else \"\")')"
>> $GITHUB_ENV
run: |
echo "PACKAGE_PATH=$(python tests/find_package_path.py)" >> $GITHUB_ENV
- name: Unit tests
run: tests/run_tests.sh -c -s ${PACKAGE_PATH}
Expand Down
7 changes: 7 additions & 0 deletions tests/find_package_path.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import importlib.util

# This is used for CI scripts to find the location of the installed package

package_name = 'ants'
package_spec = importlib.util.find_spec(package_name)
print(package_spec.submodule_search_locations[0] if package_spec else '')

0 comments on commit f90e610

Please sign in to comment.