-
Notifications
You must be signed in to change notification settings - Fork 15
Changed install scripts to be consistent with new python installation method #1417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideThis pull request refactors the Python installation process by introducing a centralized shell function, Sequence diagram for Python installation processsequenceDiagram
participant CS as Calling Script
participant IPF as install_python function
participant APT as System Package Manager (apt)
participant PPA as PPA (deadsnakes)
CS->>IPF: Execute install_python
IPF->>IPF: Check for .python_installed marker
alt Marker not found
IPF->>APT: apt update
APT-->>IPF: Done
IPF->>APT: apt install software-properties-common
APT-->>IPF: Done
IPF->>PPA: add-apt-repository ppa:deadsnakes/ppa
PPA-->>IPF: Repository added
IPF->>APT: apt update
APT-->>IPF: Done
IPF->>APT: apt install python${DATAFED_PYTHON_VERSION}...
APT-->>IPF: Python installed
IPF->>IPF: touch .python_installed marker
end
Flow diagram for the new install_python functiongraph TD
A[Start] --> B{Python already installed? Check marker file};
B -- Yes --> F[End];
B -- No --> C[apt update];
C --> D[apt install software-properties-common];
D --> E[add-apt-repository ppa:deadsnakes/ppa];
E --> G[apt update];
G --> H[apt install python, python-dev, python-venv, python-distutils];
H --> I[Create .python_installed marker file];
I --> F;
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
@@ -64,6 +64,18 @@ else | |||
fi | |||
fi | |||
|
|||
install_python() { | |||
if [ ! -e "${DATAFED_DEPENDENCIES_INSTALL_PATH}/.python_installed-${DATAFED_PYTHON_VERSION}" ]; then | |||
apt update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apt update | |
"$SUDO_CMD" apt update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This SUDO piece needs to be added to all of the apt calls.
# Install the configured Python version | ||
RUN apt update | ||
RUN apt install -y software-properties-common | ||
RUN add-apt-repository ppa:deadsnakes/ppa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the motivation for using the deadsnakes PPA for Python installation rather than the default Ubuntu repositories?
install_python() { | ||
if [ ! -e "${DATAFED_DEPENDENCIES_INSTALL_PATH}/.python_installed-${DATAFED_PYTHON_VERSION}" ]; then | ||
"$SUDO_CMD" apt update | ||
"$SUDO_CMD" apt install -y software-properties-common | ||
"$SUDO_CMD" add-apt-repository ppa:deadsnakes/ppa | ||
"$SUDO_CMD" apt update | ||
"$SUDO_CMD" apt install -y "python${DATAFED_PYTHON_VERSION}" "python${DATAFED_PYTHON_VERSION}-dev" "python${DATAFED_PYTHON_VERSION}-venv" "python${DATAFED_PYTHON_VERSION}-distutils" | ||
|
||
touch "${DATAFED_DEPENDENCIES_INSTALL_PATH}/.python_installed-${DATAFED_PYTHON_VERSION}" | ||
fi | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
* updated requirements * updated requirements * updated protobuf submodule * update unit test ci version * updated protobuf version * updated setuptools version * fixed condition * changed where packages are installed * used python3.11 to create the virtual environment instead of latest * reverted protobuf version * testing specificying version * removed pyvenv in ci job for consistency * installed python3.11 in dependencies docker file * added missing -y flag * removed unification of install scripts * added missing python3.11 install * updated ci job to install python3.11 * changed installed python version to 3.9 since protobuf does not officially support 3.11 * changed installed python version to 3.9 since protobuf does not officially support 3.11 * missed version * updated includes for newer gcc versions * updated versions * updated nlohmann json * updated json schema version * changed library search path * hopefully fixed json dep issues * updating function signature to match newer version of base class * updated protobuf * updated protobuf and cmake * downgraded cmake * fixed protobuf version * fixed protobuf version * 1398 pin python version (#1405) * Pin python version * fixed incorrect path * Switch to using .tar file install of libsodium (#1414) * 1413 libsodium build refactor (#1415) * Switch to using .tar file install of libsodium * Switch bad option in wget command from -C to -P * Update scripts/dependency_install_functions.sh * Update scripts/dependency_install_functions.sh * Update dependency_install_functions.sh Libsodium folder version number. * Update dependency_install_functions.sh Make paths explicit. * cleaned up comments * Update scripts/dependency_install_functions.sh Co-authored-by: Joshua S Brown <[email protected]> * Update cmake/JSONSchema.cmake Co-authored-by: Joshua S Brown <[email protected]> * Update scripts/dependency_install_functions.sh Co-authored-by: Joshua S Brown <[email protected]> * Update cmake/JSONSchema.cmake Co-authored-by: Joshua S Brown <[email protected]> * add changes from review * Changed install scripts to be consistent with new python installation method (#1417) * changed install scripts to be consistent * added sudo check * add apt sources check --------- Co-authored-by: Blake Nedved <[email protected]> Co-authored-by: nedvedba <[email protected]>
Summary by Sourcery
Update installation scripts to consistently install Python using a new method across different dependency installation scripts
New Features:
install_python()
function in dependency installation scriptsEnhancements:
Chores: