Skip to content

Commit

Permalink
feat: explicit python version in helper scripts and docker (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
vishwa2710 authored Jun 18, 2024
1 parent abd8dea commit aef1ea8
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 3 additions & 1 deletion docker/development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tools/development/helpers/check-format-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion tools/development/helpers/docs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

# Apache License 2.0

project_directory="$(git rev-parse --show-toplevel)"
docs_directory="${project_directory}/docs"

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/development/helpers/format-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 6 additions & 8 deletions tools/development/helpers/install-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
4 changes: 1 addition & 3 deletions tools/development/helpers/test-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit aef1ea8

Please sign in to comment.