mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-30 01:51:05 -05:00
7e1683407d
* Simplify virtualenv installation to use multiple requirements files in a single directory. This eliminates the packages.txt file and provides an easier path to adding new tools in the future. It also allows us to simplify the dependenabot configuration as all requirements files are in a single directory. * Update dependabot.yml to point to the new Python dependencies folder.
40 lines
1.3 KiB
Bash
Executable file
40 lines
1.3 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
################################################################################
|
|
########################### Install Python Dependancies ########################
|
|
################################################################################
|
|
|
|
#####################
|
|
# Set fail on error #
|
|
#####################
|
|
set -euo pipefail
|
|
|
|
############################
|
|
# Create staging directory #
|
|
############################
|
|
mkdir -p /venvs
|
|
|
|
########################################
|
|
# Install basic libs to run installers #
|
|
########################################
|
|
pip install virtualenv
|
|
|
|
#########################################################
|
|
# Itterate through requirments.txt to install bainaries #
|
|
#########################################################
|
|
for DEP_FILE in *.txt; do
|
|
# split the package name from its version
|
|
PACKAGE_NAME=${DEP_FILE%.txt}
|
|
echo "-------------------------------------------"
|
|
mkdir -p "/venvs/${PACKAGE_NAME}"
|
|
cp "${DEP_FILE}" "/venvs/${PACKAGE_NAME}/requirements.txt"
|
|
echo "Generating virtualenv for: [${PACKAGE_NAME}]"
|
|
pushd "/venvs/${PACKAGE_NAME}"
|
|
virtualenv .
|
|
# shellcheck disable=SC1091
|
|
source bin/activate
|
|
pip install -r requirements.txt
|
|
# deactivate the python virtualenv
|
|
deactivate
|
|
# pop the stack
|
|
popd
|
|
done
|