diff --git a/docker/development/Dockerfile b/docker/development/Dockerfile index fde33d4..73c5429 100644 --- a/docker/development/Dockerfile +++ b/docker/development/Dockerfile @@ -185,8 +185,10 @@ RUN mkdir /tmp/openssl \ && rm -rf /tmp/openssl ## Black +ARG OSTK_PYTHON_VERSION +ENV OSTK_PYTHON_VERSION 3.11 -RUN python3.11 -m pip install black black[jupyter] +RUN python${OSTK_PYTHON_VERSION} -m pip install black black[jupyter] # Environment diff --git a/tools/development/helpers/check-format-python.sh b/tools/development/helpers/check-format-python.sh index 9b85114..ff0f009 100755 --- a/tools/development/helpers/check-format-python.sh +++ b/tools/development/helpers/check-format-python.sh @@ -6,6 +6,6 @@ project_directory="$(git rev-parse --show-toplevel)" pushd "${project_directory}" > /dev/null - python3.11 -m black --check --diff bindings/python/ + python${OSTK_PYTHON_VERSION} -m black --check --diff bindings/python/ popd > /dev/null diff --git a/tools/development/helpers/docs.sh b/tools/development/helpers/docs.sh index 1cdec6c..c7090d9 100644 --- a/tools/development/helpers/docs.sh +++ b/tools/development/helpers/docs.sh @@ -1,5 +1,7 @@ #!/bin/bash +# Apache License 2.0 + project_directory="$(git rev-parse --show-toplevel)" docs_directory="${project_directory}/docs" @@ -18,7 +20,7 @@ if [[ $1 == "--help" ]]; then exit 0 fi -pip install -r requirements.txt +python${OSTK_PYTHON_VERSION} -m pip install -r requirements.txt if [[ ! -z $1 ]] && [[ $1 == "--notebooks" ]]; then if [[ -z $2 ]]; then diff --git a/tools/development/helpers/format-python.sh b/tools/development/helpers/format-python.sh index cee33e5..3afb1fd 100755 --- a/tools/development/helpers/format-python.sh +++ b/tools/development/helpers/format-python.sh @@ -6,6 +6,6 @@ project_directory="$(git rev-parse --show-toplevel)" pushd "${project_directory}" > /dev/null - python3.11 -m black bindings/python/ + python${OSTK_PYTHON_VERSION} -m black bindings/python/ popd > /dev/null diff --git a/tools/development/helpers/install-python.sh b/tools/development/helpers/install-python.sh index 807aa02..288c449 100755 --- a/tools/development/helpers/install-python.sh +++ b/tools/development/helpers/install-python.sh @@ -2,18 +2,16 @@ # Apache License 2.0 -PYTHON_VERSION="3.11" - -py_version=$(echo "${PYTHON_VERSION}" | sed 's/\.//') +py_version=$(echo "${OSTK_PYTHON_VERSION}" | sed 's/\.//') project_directory="$(git rev-parse --show-toplevel)" -python_directory="${project_directory}/build/bindings/python/OpenSpaceToolkit*Py-python-package-${PYTHON_VERSION}" +python_directory="${project_directory}/build/bindings/python/OpenSpaceToolkit*Py-python-package-${OSTK_PYTHON_VERSION}" pushd ${python_directory} > /dev/null -python${PYTHON_VERSION} -m pip install plotly pandas -python${PYTHON_VERSION} -m pip install git+https://github.com/open-space-collective/cesiumpy -python${PYTHON_VERSION} -m pip install . --force-reinstall +python${OSTK_PYTHON_VERSION} -m pip install plotly pandas +python${OSTK_PYTHON_VERSION} -m pip install git+https://github.com/open-space-collective/cesiumpy +python${OSTK_PYTHON_VERSION} -m pip install . --force-reinstall popd > /dev/null @@ -24,6 +22,6 @@ do dep_underscore=$(echo ${dep} | tr '-' '_' | sed 's/\/$//') - python${PYTHON_VERSION} -m pip install /usr/local/share/${dep_underscore}-*-py${py_version}-*.whl --quiet --force-reinstall; + python${OSTK_PYTHON_VERSION} -m pip install /usr/local/share/${dep_underscore}-*-py${py_version}-*.whl --quiet --force-reinstall; done diff --git a/tools/development/helpers/test-python.sh b/tools/development/helpers/test-python.sh index c0c5259..47351e7 100755 --- a/tools/development/helpers/test-python.sh +++ b/tools/development/helpers/test-python.sh @@ -2,13 +2,11 @@ # Apache License 2.0 -PYTHON_VERSION="3.11" - project_directory="$(git rev-parse --show-toplevel)" test_directory="${project_directory}/bindings/python/test" pushd "${test_directory}" > /dev/null -python${PYTHON_VERSION} -m pytest -sv ${@} +python${OSTK_PYTHON_VERSION} -m pytest -sv ${@} popd > /dev/null