Simplify pip requirements files (#4796)

This commit is contained in:
Marco Ferrari 2023-10-28 02:07:51 +03:00 committed by GitHub
parent 40b5a7da51
commit 9ee2eed763
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 3 additions and 272 deletions

View file

@ -1,41 +0,0 @@
#!/usr/bin/env bash
# Enable strict error checking
set -euo pipefail
# Install ncu
npm i -g npm-check-updates
pushd dependencies
# Update all dependencies
echo "Installing NPM dependencies..."
npm install
echo "Updating NPM dependencies..."
ncu -u
echo "Removing existing lockfile..."
rm -rf package-lock.json
echo "Installing NPM dependencies..."
npm install
# Setup Git Config
echo "Configuring Git..."
git config --global user.email "noreply@github.com"
git config --global user.name "Super-Linter Automation"
if [[ $(git status --porcelain) ]]; then
# Push changes to remote
echo "Pushing changes to remote..."
git add .
git commit -a -m "Update NPM dependencies"
# shellcheck disable=SC2154
git checkout -b "npm_deps_${id}"
# shellcheck disable=SC2154
git push origin "npm_deps_${id}"
# Open pull request
echo "Opening pull request..."
# shellcheck disable=SC2154
echo "${token}" | gh auth login --with-token
gh pr create --title "Weekly NPM Updates" --body "Updates NPM dependencies" --base main --head "npm_deps_${id}"
else
echo "No changes to commit"
fi

View file

@ -1,80 +0,0 @@
#!/usr/bin/env bash
################################################################################
########################### Install Python Dependancies ########################
################################################################################
#####################
# Set fail on error #
#####################
set -euo pipefail
############################
# Create staging directory #
############################
# shellcheck disable=SC2154
mkdir -p "${working_directory}/venvs"
########################################
# Install basic libs to run installers #
########################################
pip install virtualenv
#########################################################
# Itterate through requirments.txt to install bainaries #
#########################################################
cd dependencies/python
for DEP_FILE in *.txt; do
# split the package name from its version
PACKAGE_NAME=${DEP_FILE%.txt}
echo "-------------------------------------------"
mkdir -p "${working_directory}/venvs/${PACKAGE_NAME}"
echo "Generating virtualenv for: [${PACKAGE_NAME}]"
pushd "${working_directory}/venvs/${PACKAGE_NAME}"
# Enable virtualenv
virtualenv .
# Activate virtualenv
# shellcheck disable=SC1091
source bin/activate
# Handle the ansibl-lint corner case
if [[ $PACKAGE_NAME == "ansible-lint" ]]; then
pip install "ansible-lint[core]"
else
pip install "${PACKAGE_NAME}"
fi
# Generate an update requirements.txt
pip freeze >requirements.txt
# deactivate the python virtualenv
deactivate
# pop the stack
popd
# Remove old lockfile
rm -rf "$DEP_FILE"
# Create new lockfile
mv "${working_directory}/venvs/${PACKAGE_NAME}/requirements.txt" "${DEP_FILE}"
done
git status
# Setup Git Config
echo "Configuring Git..."
git config --global user.email "noreply@github.com"
git config --global user.name "Super-Linter Automation"
if [[ $(git status --porcelain) ]]; then
# Push changes to remote
echo "Pushing changes to remote..."
git add .
git commit -a -m "Update Python dependencies"
# shellcheck disable=SC2154
git checkout -b "python_deps_${id}"
# shellcheck disable=SC2154
git push origin "python_deps_${id}"
# Open pull request
echo "Opening pull request..."
# shellcheck disable=SC2154
echo "${token}" | gh auth login --with-token
gh pr create --title "Weekly Python Updates" --body "Updates Python dependencies" --base main --head "python_deps_${id}"
else
echo "No changes to commit"
fi

View file

@ -1,30 +1 @@
ansible-core==2.15.0
ansible-lint==6.16.2 ansible-lint==6.16.2
attrs==23.1.0
black==23.3.0
bracex==2.4
cffi==1.15.1
click==8.1.3
cryptography==41.0.3
filelock==3.12.2
Jinja2==3.1.2
jsonschema==4.19.0
markdown-it-py==2.2.0
MarkupSafe==2.1.2
mdurl==0.1.2
mypy-extensions==1.0.0
packaging==23.2
pathspec==0.11.2
platformdirs==3.5.1
pycparser==2.21
Pygments==2.15.1
pyrsistent==0.19.3
PyYAML==6.0.1
resolvelib==1.0.1
rich==13.5.2
ruamel.yaml==0.17.32
ruamel.yaml.clib==0.2.7
subprocess-tee==0.4.1
tomli==2.0.1
wcmatch==8.5
yamllint==1.31.0

View file

@ -1,7 +1 @@
black==23.3.0 black==23.3.0
click==8.1.3
mypy-extensions==1.0.0
packaging==23.2
pathspec==0.11.2
platformdirs==3.5.1
tomli==2.0.1

View file

@ -18,9 +18,9 @@ mkdir -p /venvs
######################################## ########################################
pip install virtualenv pip install virtualenv
######################################################### #######################################################
# Itterate through requirments.txt to install bainaries # # Iterate through requirments.txt to install binaries #
######################################################### #######################################################
for DEP_FILE in *.txt; do for DEP_FILE in *.txt; do
# split the package name from its version # split the package name from its version
PACKAGE_NAME=${DEP_FILE%.txt} PACKAGE_NAME=${DEP_FILE%.txt}

View file

@ -1,26 +1 @@
attrs==23.1.0
aws-sam-translator==1.73.0
boto3==1.28.1
botocore==1.31.1
cfn-lint==0.80.3 cfn-lint==0.80.3
jmespath==1.0.1
jschema-to-python==1.2.3
jsonpatch==1.33
jsonpickle==3.0.2
jsonpointer==2.4
jsonschema==4.19.0
junit-xml==1.9
mpmath==1.3.0
networkx==3.1
pbr==5.11.1
pydantic==1.10.9
pyrsistent==0.19.3
python-dateutil==2.8.2
PyYAML==6.0.1
regex==2023.6.3
s3transfer==0.6.0
sarif-om==1.0.4
six==1.16.0
sympy==1.11.1
typing_extensions==4.7.1
urllib3==1.26.15

View file

@ -1,4 +1 @@
flake8==6.0.0 flake8==6.0.0
mccabe==0.7.0
pycodestyle==2.10.0
pyflakes==3.0.1

View file

@ -1,4 +1 @@
mypy==1.5.1 mypy==1.5.1
mypy-extensions==1.0.0
tomli==2.0.1
typing_extensions==4.7.1

View file

@ -1,11 +1 @@
astroid==2.15.6
dill==0.3.7
isort==5.12.0
lazy-object-proxy==1.9.0
mccabe==0.7.0
platformdirs==3.5.1
pylint==2.17.4 pylint==2.17.4
tomli==2.0.1
tomlkit==0.11.8
typing_extensions==4.7.1
wrapt==1.15.0

View file

@ -1,9 +1 @@
black==23.3.0
click==8.1.3
mypy-extensions==1.0.0
packaging==23.2
pathspec==0.11.2
platformdirs==3.5.1
snakefmt==0.8.4 snakefmt==0.8.4
toml==0.10.2
tomli==2.0.1

View file

@ -1,38 +1 @@
appdirs==1.4.4
attrs==23.1.0
certifi==2022.12.7
charset-normalizer==3.2.0
ConfigArgParse==1.7
connection-pool==0.0.3
datrie==0.8.2
docutils==0.20.1
dpath==2.1.6
fastjsonschema==2.18.0
gitdb==4.0.10
GitPython==3.1.31
humanfriendly==10.0
idna==3.4
Jinja2==3.1.2
jsonschema==4.19.0
jupyter_core==5.3.1
MarkupSafe==2.1.2
nbformat==5.8.0
plac==1.3.5
platformdirs==3.5.1
psutil==5.9.5
PuLP==2.7.0
pyrsistent==0.19.3
PyYAML==6.0.1
requests==2.31.0
reretry==0.11.8
smart-open==6.3.0
smmap==5.0.0
snakemake==7.30.1 snakemake==7.30.1
stopit==1.1.2
tabulate==0.9.0
throttler==1.2.2
toposort==1.10
traitlets==5.9.0
urllib3==1.26.15
wrapt==1.15.0
yte==1.5.1

View file

@ -1,22 +1 @@
appdirs==1.4.4
chardet==5.1.0
click==8.1.3
colorama==0.4.6
diff-cover==7.7.0
exceptiongroup==1.1.2
iniconfig==2.0.0
Jinja2==3.1.2
MarkupSafe==2.1.2
packaging==23.2
pathspec==0.11.2
pluggy==1.0.0
Pygments==2.15.1
pytest==7.4.0
PyYAML==6.0.1
regex==2023.6.3
sqlfluff==2.1.2 sqlfluff==2.1.2
tblib==1.7.0
toml==0.10.2
tomli==2.0.1
tqdm==4.65.0
typing_extensions==4.7.1

View file

@ -1,3 +1 @@
pathspec==0.11.2
PyYAML==6.0.1
yamllint==1.31.0 yamllint==1.31.0

View file

@ -1,5 +1 @@
argcomplete==3.1.1
PyYAML==6.0.1
tomlkit==0.11.8
xmltodict==0.13.0
yq==3.2.2 yq==3.2.2