Skip to content
Snippets Groups Projects
Unverified Commit 56f9caba authored by Brent Huisman's avatar Brent Huisman Committed by GitHub
Browse files

Fix a bug where Debian/Ubuntu's Python malfunctions (#1894)

Upstream bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1006615



Currently affects Ubuntu 22.04 users.

Co-authored-by: default avatarSimon Frasch <simon.frasch@cscs.ch>
parent bb723be6
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,8 @@ jobs: ...@@ -24,6 +24,8 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
submodules: recursive submodules: recursive
- name: Update pip
run: python -m pip install --upgrade pip
- name: Build wheels Linux - name: Build wheels Linux
if: ${{ startsWith(matrix.os, 'ubuntu') }} if: ${{ startsWith(matrix.os, 'ubuntu') }}
...@@ -66,6 +68,8 @@ jobs: ...@@ -66,6 +68,8 @@ jobs:
steps: steps:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v2
- name: Update pip
run: python -m pip install --upgrade pip
- name: Get packages - name: Get packages
run: python -m pip install numpy setuptools scikit-build ninja cmake run: python -m pip install numpy setuptools scikit-build ninja cmake
- uses: actions/checkout@v2 - uses: actions/checkout@v2
......
...@@ -27,6 +27,8 @@ jobs: ...@@ -27,6 +27,8 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
submodules: recursive submodules: recursive
- name: Update pip
run: python -m pip install --upgrade pip
- name: Build arbor - name: Build arbor
run: | run: |
mkdir build mkdir build
......
...@@ -110,6 +110,8 @@ jobs: ...@@ -110,6 +110,8 @@ jobs:
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.config.py }} python-version: ${{ matrix.config.py }}
- name: Update pip
run: python -m pip install --upgrade pip
- name: OpenMPI cache - name: OpenMPI cache
uses: actions/cache@v2 uses: actions/cache@v2
id: cache-ompi id: cache-ompi
...@@ -200,6 +202,8 @@ jobs: ...@@ -200,6 +202,8 @@ jobs:
name: "Pip build test + Python examples test" name: "Pip build test + Python examples test"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install Python packages - name: Install Python packages
run: pip install numpy setuptools scikit-build ninja cmake run: pip install numpy setuptools scikit-build ninja cmake
- name: Clone w/ submodules - name: Clone w/ submodules
......
...@@ -85,8 +85,7 @@ file(COPY "${PROJECT_SOURCE_DIR}/VERSION" DESTINATION "${python_mod_path}") ...@@ -85,8 +85,7 @@ file(COPY "${PROJECT_SOURCE_DIR}/VERSION" DESTINATION "${python_mod_path}")
file(WRITE "${CMAKE_BINARY_DIR}/install-prefix" "${CMAKE_INSTALL_PREFIX}") file(WRITE "${CMAKE_BINARY_DIR}/install-prefix" "${CMAKE_INSTALL_PREFIX}")
execute_process( execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c COMMAND ${PYTHON_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/where.py"
"import sys,sysconfig;pfx=sys.stdin.read();print(sysconfig.get_path('platlib',vars={} if pfx=='' else {'base':pfx,'platbase':pfx}))"
INPUT_FILE "${CMAKE_BINARY_DIR}/install-prefix" INPUT_FILE "${CMAKE_BINARY_DIR}/install-prefix"
OUTPUT_VARIABLE ARB_PYTHON_LIB_PATH_DEFAULT OUTPUT_VARIABLE ARB_PYTHON_LIB_PATH_DEFAULT
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
......
import sys,sysconfig
pfx=sys.stdin.read()
try:
#override scheme on debian/ubuntu py3.10, where 'posix_local' is set and malfunctioning.
if sysconfig.get_default_scheme()=='posix_local':
print(sysconfig.get_path('platlib',vars={} if pfx=='' else {'base':pfx,'platbase':pfx},scheme='posix_prefix'))
sys.exit()
except AttributeError:
#we're on Python <= 3.9, no scheme setting required and get_default_scheme does not exist.
pass
print(sysconfig.get_path('platlib',vars={} if pfx=='' else {'base':pfx,'platbase':pfx}))
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment