Skip to content

Commit

Permalink
ci: override the python version of the builds
Browse files Browse the repository at this point in the history
- Always use a predfeined python version for the builds
instead of the system default one.

Signed-off-by: Adrian Stanea <[email protected]>
  • Loading branch information
Adrian-Stanea committed Oct 17, 2024
1 parent 2222c0d commit 6bd4377
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CI/macOS/make_macOS
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ make_package() {
echo "### Make OSX packague"
mkdir -p "${WORKDIR}"/build && cd "${WORKDIR}"/build
cmake "$WORKDIR" \
-DPYTHON_EXECUTABLE:FILEPATH=$(python -c "import os, sys; print(os.path.dirname(sys.executable) + '/python')") \
-DPYTHON_EXECUTABLE:FILEPATH="$(${PYTHON} -c 'import os, sys; print(os.path.dirname(sys.executable))')/${PYTHON}" \
-DOSX_PACKAGE=ON \
-DENABLE_TOOLS=ON \
-DENABLE_PYTHON=ON \
Expand All @@ -25,7 +25,7 @@ make_tar() {
echo "### Make OSX tar"
mkdir -p "${WORKDIR}"/build_tar && cd "${WORKDIR}"/build_tar
cmake "${WORKDIR}" \
-DPYTHON_EXECUTABLE:FILEPATH=$(python -c "import os, sys; print(os.path.dirname(sys.executable) + '/python')") \
-DPYTHON_EXECUTABLE:FILEPATH="$(${PYTHON} -c 'import os, sys; print(os.path.dirname(sys.executable))')/${PYTHON}" \
-DOSX_PACKAGE=OFF \
-DENABLE_PACKAGING=ON \
-DENABLE_PYTHON=ON \
Expand Down
2 changes: 1 addition & 1 deletion CI/ubuntu/install_deps
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ build_libiio() {
-DCPACK_SYSTEM_NAME=${ARTIFACTNAME} \
-DENABLE_PACKAGING=ON \
-DPYTHON_BINDINGS=ON \
-DPYTHON_EXECUTABLE:FILEPATH="$("$PYTHON" -c 'import os, sys; print(os.path.dirname(sys.executable) + "/python")')" \
-DPYTHON_EXECUTABLE:FILEPATH="$(${PYTHON} -c 'import os, sys; print(os.path.dirname(sys.executable))')/${PYTHON}" \
-DWITH_DOC=ON \
-DWITH_MAN=ON \
-DWITH_SERIAL_BACKEND=ON
Expand Down
4 changes: 2 additions & 2 deletions CI/ubuntu/make_linux
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ handle_default() {
-DENABLE_LOG=ON \
-DENABLE_PYTHON=ON \
-DENABLE_TOOLS=ON \
-DPYTHON_EXECUTABLE:FILEPATH=$(python -c "import os, sys; print(os.path.dirname(sys.executable) + '/python')")
-DPYTHON_EXECUTABLE:FILEPATH="$(${PYTHON} -c 'import os, sys; print(os.path.dirname(sys.executable))')/${PYTHON}" \
make
sudo python3 setup.py --command-packages=stdeb.command sdist_dsc
cd "$(find . -type d -name "debian" | head -n 1)"
Expand All @@ -35,7 +35,7 @@ handle_default() {
-DENABLE_LOG=ON \
-DENABLE_PACKAGING=ON \
-DENABLE_PYTHON=OFF \
-DPYTHON_EXECUTABLE:FILEPATH=$(python -c "import os, sys; print(os.path.dirname(sys.executable) + '/python')")
-DPYTHON_EXECUTABLE:FILEPATH="$(${PYTHON} -c 'import os, sys; print(os.path.dirname(sys.executable))')/${PYTHON}" \
make && make package
ls
}
Expand Down
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
variables:
libiioPipelineId: 9
PYTHON: python
PYTHON: python3.11
PIP: pip
AnalogDevices_OpenSource_GUID: '02a28b00-b3c8-4fdf-af9c-c2460499147f'
IS_PULL_REQUEST: ${{ eq('$(Build.Reason)', 'PullRequest') }}
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
persistCredentials: true
- task: UsePythonVersion@0
inputs:
versionSpec: '3.11'
versionSpec: '$(PYTHON)'
addToPath: true
- script: ./CI/ubuntu/install_deps
displayName: "Install Dependencies"
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
# clean: true
# - task: UsePythonVersion@0
# inputs:
# versionSpec: '3.11'
# versionSpec: '$(PYTHON)'
# addToPath: true
# - script: ./CI/macOS/install_deps
# displayName: "Install Dependencies"
Expand Down Expand Up @@ -213,7 +213,7 @@ jobs:
# clean: true
# - task: UsePythonVersion@0
# inputs:
# versionSpec: '3.11'
# versionSpec: '$(PYTHON)'
# - task: PowerShell@2
# displayName: 'Install Dependencies'
# inputs:
Expand Down

0 comments on commit 6bd4377

Please sign in to comment.