From 3d3aa4c8036b94645f441d3bbbc18b5aea94eee5 Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Sat, 7 Sep 2024 11:50:51 -0500 Subject: [PATCH] Add patches to allow overriding Python versions better. --- scripts/configure.sh | 8 ++++---- scripts/theme.sh | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/configure.sh b/scripts/configure.sh index 2972965..230c683 100755 --- a/scripts/configure.sh +++ b/scripts/configure.sh @@ -22,13 +22,13 @@ if ! is-set PYTHON; then PYTHON=python fi frameworks=("pyqt5" "pyqt6" "pyside6") -have_pyside=$(PYTHON -c 'import sys; print(sys.version_info < (3, 11))') +have_pyside=$(${PYTHON} -c 'import sys; print(sys.version_info < (3, 11))') if [[ "${have_pyside}" == "True" ]]; then frameworks+=("pyside2") fi # NOTE: We need to make sure the scripts directory is added to the path -python_home=$(PYTHON -c 'import site; print(site.getsitepackages()[0])') +python_home=$(${PYTHON} -c 'import site; print(site.getsitepackages()[0])') scripts_dir="${python_home}/scripts" uname_s="$(uname -s)" if [[ "${uname_s}" == MINGW* ]]; then @@ -37,7 +37,7 @@ if [[ "${uname_s}" == MINGW* ]]; then fi export PATH="${scripts_dir}:${PATH}" for framework in "${frameworks[@]}"; do - "${PYTHON}" "${project_home}/configure.py" \ + ${PYTHON} "${project_home}/configure.py" \ --styles=all \ --extensions=all \ --qt-framework "${framework}" \ @@ -45,5 +45,5 @@ for framework in "${frameworks[@]}"; do --resource "breeze_${framework}.qrc" \ --compiled-resource "${project_home}/dist/ci/breeze_${framework}.py" # this will auto-fail due to pipefail, checks the imports work - "${PYTHON}" -c "import os; os.chdir('dist/ci'); import breeze_${framework}" + ${PYTHON} -c "import os; os.chdir('dist/ci'); import breeze_${framework}" done diff --git a/scripts/theme.sh b/scripts/theme.sh index f4fd6f0..4176bb8 100755 --- a/scripts/theme.sh +++ b/scripts/theme.sh @@ -13,10 +13,10 @@ cd "${project_home}/example" if ! is-set PYTHON; then PYTHON=python fi -theme=$("${PYTHON}" -c "import breeze_theme; print(breeze_theme.get_theme())") +theme=$(${PYTHON} -c "import breeze_theme; print(breeze_theme.get_theme())") if [[ "${theme}" != Theme.* ]]; then >&2 echo "Unable to get the correct theme." exit 1 fi -"${PYTHON}" -c "import breeze_theme; print(breeze_theme.is_light())" -"${PYTHON}" -c "import breeze_theme; print(breeze_theme.is_dark())" +${PYTHON} -c "import breeze_theme; print(breeze_theme.is_light())" +${PYTHON} -c "import breeze_theme; print(breeze_theme.is_dark())"