Skip to content

Commit

Permalink
[FIX] Use python's sys.version_info.minor to ensure correct library
Browse files Browse the repository at this point in the history
To avoid finding multiple directories that have 'python' in the name
under /usr/local/lib/ on the GitHub Actions runners, use Python's
sys.version_info.minor to get the minor version of python3. As we know
that we're using Python 3, the minor version is the only piece of information
that needs to be determined.
  • Loading branch information
matthewfeickert committed Apr 26, 2022
1 parent 9db73ec commit 991fcb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Expand Up @@ -282,8 +282,8 @@ jobs:
- name: Verify Python bindings
run: |
export LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}"
export PYTHON_VERSION_MINOR=$(_tmp=$(find /usr/local/lib/ -type d -iname "python*") && echo ${_tmp: -3}; unset _tmp)
export PYTHONPATH="/usr/local/lib/python${PYTHON_VERSION_MINOR}/site-packages:${PYTHONPATH}"
export PYTHON_VERSION_MINOR=$(python3 -c 'import sys; print(f"{sys.version_info.minor}")')
export PYTHONPATH="/usr/local/lib/python3.${PYTHON_VERSION_MINOR}/site-packages:${PYTHONPATH}"
python3 -m pip list
python3 -m pip show xrootd
python3 -c 'import XRootD; print(XRootD)'
Expand Down

0 comments on commit 991fcb6

Please sign in to comment.