Skip to content

Commit

Permalink
Add patches to allow overriding Python versions better.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexhuszagh committed Sep 7, 2024
1 parent 8cb8241 commit 3d3aa4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions scripts/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,13 +37,13 @@ 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}" \
--output-dir "${project_home}/dist/ci" \
--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
6 changes: 3 additions & 3 deletions scripts/theme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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())"

0 comments on commit 3d3aa4c

Please sign in to comment.