Skip to content

Commit

Permalink
Upgrade dependencies, have Python-version-specific fixed dependency tree
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Mar 15, 2024
1 parent 1be9295 commit 65fa02d
Show file tree
Hide file tree
Showing 13 changed files with 166 additions and 38 deletions.
9 changes: 5 additions & 4 deletions .github/upgrade-pip-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
set -euo pipefail

base="$(dirname "$0")"
python_minor_version="$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')"

pip install --upgrade --force pip==22.0.0
pip install --upgrade --upgrade-strategy eager -r "$base/../python/requirements-direct.txt"
pip install --upgrade --force pip==24.0.0
pip install --upgrade --upgrade-strategy eager -r "$base/../python/requirements.txt"

pip install pipdeptree
pipdeptree --packages="$(sed -e "s/;.*//" -e "s/=.*//g" "$base/../python/requirements-direct.txt" | paste -s -d ,)" --freeze > "$base/../python/requirements.txt"
pipdeptree --packages="$(sed -e "s/;.*//" -e "s/=.*//g" "$base/../python/requirements.txt" | paste -s -d ,)" --freeze > "$base/../python/requirements-$python_minor_version.txt"

git diff "$base/../python/requirements.txt"
git diff "$base/../python/requirements-$python_minor_version.txt"

14 changes: 10 additions & 4 deletions composite/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,15 @@ runs:
echo "Python that creates venv: $PYTHON_BIN"
echo "PYTHON_BIN=$PYTHON_BIN" >> "$GITHUB_ENV"
echo "version=$("$PYTHON_BIN" -V)" >> "$GITHUB_OUTPUT"
PYTHON_VERSION="$($PYTHON_BIN -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}"))"
if [[ "$PYTHON_VERSION" == "3.7" ]]
then
echo "DEPENDENCIES_VERSION=3.7" >> "$GITHUB_ENV"
else
echo "DEPENDENCIES_VERSION=post-3.7" >> "$GITHUB_ENV"
fi
echo "version=$PYTHON_VERSION" >> "$GITHUB_OUTPUT"
echo '::endgroup::'
shell: bash
Expand Down Expand Up @@ -263,9 +271,7 @@ runs:
# Install Python dependencies
echo '::group::Install Python dependencies'
# make sure wheel is installed, which improves installing our dependencies
"$PYTHON_VENV" -m pip install wheel
"$PYTHON_VENV" -m pip install -r "$GITHUB_ACTION_PATH/../python/requirements.txt"
"$PYTHON_VENV" -m pip install -r "$GITHUB_ACTION_PATH/../python/requirements-$DEPENDENCIES_VERSION.txt"
echo '::endgroup::'
shell: bash
Expand Down
10 changes: 9 additions & 1 deletion linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,15 @@ runs:
echo "Python that creates venv: $PYTHON_BIN"
echo "PYTHON_BIN=$PYTHON_BIN" >> "$GITHUB_ENV"
echo "version=$("$PYTHON_BIN" -V)" >> "$GITHUB_OUTPUT"
PYTHON_VERSION="$($PYTHON_BIN -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}"))"
if [[ "$PYTHON_VERSION" == "3.7" ]]
then
echo "DEPENDENCIES_VERSION=3.7" >> "$GITHUB_ENV"
else
echo "DEPENDENCIES_VERSION=post-3.7" >> "$GITHUB_ENV"
fi
echo "version=$PYTHON_VERSION" >> "$GITHUB_OUTPUT"
echo '::endgroup::'
shell: bash
Expand Down
18 changes: 18 additions & 0 deletions python/requirements-3.10.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
humanize==4.9.0
junitparser==3.1.2
lxml==5.1.0
psutil==5.9.8
PyGithub==2.2.0
Deprecated==1.2.14
wrapt==1.16.0
PyJWT==2.8.0
PyNaCl==1.5.0
cffi==1.16.0
pycparser==2.21
requests==2.31.0
certifi==2024.2.2
charset-normalizer==3.3.2
idna==3.6
urllib3==2.2.1
typing_extensions==4.10.0
urllib3==2.2.1
18 changes: 18 additions & 0 deletions python/requirements-3.11.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
humanize==4.9.0
junitparser==3.1.2
lxml==5.1.0
psutil==5.9.8
PyGithub==2.2.0
Deprecated==1.2.14
wrapt==1.16.0
PyJWT==2.8.0
PyNaCl==1.5.0
cffi==1.16.0
pycparser==2.21
requests==2.31.0
certifi==2024.2.2
charset-normalizer==3.3.2
idna==3.6
urllib3==2.2.1
typing_extensions==4.10.0
urllib3==2.2.1
18 changes: 18 additions & 0 deletions python/requirements-3.12.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
humanize==4.9.0
junitparser==3.1.2
lxml==5.1.0
psutil==5.9.8
PyGithub==2.2.0
Deprecated==1.2.14
wrapt==1.16.0
PyJWT==2.8.0
PyNaCl==1.5.0
cffi==1.16.0
pycparser==2.21
requests==2.31.0
certifi==2024.2.2
charset-normalizer==3.3.2
idna==3.6
urllib3==2.2.1
typing_extensions==4.10.0
urllib3==2.2.1
22 changes: 22 additions & 0 deletions python/requirements-3.7.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
humanize==4.6.0
importlib-metadata==6.7.0
typing_extensions==4.7.1
zipp==3.15.0
junitparser==3.1.2
lxml==5.1.0
psutil==5.9.8
PyGithub==2.2.0
Deprecated==1.2.14
wrapt==1.16.0
PyJWT==2.8.0
typing_extensions==4.7.1
PyNaCl==1.5.0
cffi==1.15.1
pycparser==2.21
requests==2.31.0
certifi==2024.2.2
charset-normalizer==3.3.2
idna==3.6
urllib3==2.0.7
typing_extensions==4.7.1
urllib3==2.0.7
18 changes: 18 additions & 0 deletions python/requirements-3.8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
humanize==4.9.0
junitparser==3.1.2
lxml==5.1.0
psutil==5.9.8
PyGithub==2.2.0
Deprecated==1.2.14
wrapt==1.16.0
PyJWT==2.8.0
PyNaCl==1.5.0
cffi==1.16.0
pycparser==2.21
requests==2.31.0
certifi==2024.2.2
charset-normalizer==3.3.2
idna==3.6
urllib3==2.2.1
typing_extensions==4.10.0
urllib3==2.2.1
18 changes: 18 additions & 0 deletions python/requirements-3.9.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
humanize==4.9.0
junitparser==3.1.2
lxml==5.1.0
psutil==5.9.8
PyGithub==2.2.0
Deprecated==1.2.14
wrapt==1.16.0
PyJWT==2.8.0
PyNaCl==1.5.0
cffi==1.16.0
pycparser==2.21
requests==2.31.0
certifi==2024.2.2
charset-normalizer==3.3.2
idna==3.6
urllib3==2.2.1
typing_extensions==4.10.0
urllib3==2.2.1
5 changes: 0 additions & 5 deletions python/requirements-direct.txt

This file was deleted.

18 changes: 18 additions & 0 deletions python/requirements-post-3.7.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
humanize==4.9.0
junitparser==3.1.2
lxml==5.1.0
psutil==5.9.8
PyGithub==2.2.0
Deprecated==1.2.14
wrapt==1.16.0
PyJWT==2.8.0
PyNaCl==1.5.0
cffi==1.16.0
pycparser==2.21
requests==2.31.0
certifi==2024.2.2
charset-normalizer==3.3.2
idna==3.6
urllib3==2.2.1
typing_extensions==4.10.0
urllib3==2.2.1
29 changes: 5 additions & 24 deletions python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
humanize==3.14.0
junitparser==3.1.0
future==0.18.3
humanize==4.6.0; python_version <= '3.7'
humanize==4.9.0; python_version > '3.7'
junitparser==3.1.2
lxml==5.1.0
psutil==5.9.7
PyGithub==2.1.1
Deprecated==1.2.14
wrapt==1.16.0
PyJWT==2.8.0
PyNaCl==1.5.0
# latest version that support Python 3.7
cffi==1.15.1
pycparser==2.21
python-dateutil==2.8.2
six==1.16.0
requests==2.31.0
certifi==2023.11.17
charset-normalizer==3.3.2
idna==3.6
# latest version that support Python 3.7
urllib3==2.0.7
# latest version that support Python 3.7
typing_extensions==4.7.1
# latest version that support Python 3.7
urllib3==2.0.7
psutil==5.9.8
PyGithub==2.2.0
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[tox]
envlist = py{37,38,39,310,311,312}

[testenv]
commands = .github/upgrade-pip-packages.sh
allowlist_externals = .github/upgrade-pip-packages.sh

0 comments on commit 65fa02d

Please sign in to comment.