-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix versions in requirements.txt for python 3.5 and 3.9 (#20507)
Packages listed in current requirements.txt file cannot be installed in python 3.5 and 3.9: * Pillow doesn't have a candidate for 3.9, it was already removed in #20407, but added again by mistake in #16883. * zipp package needed by pytest works with different versions depending on the version of python, version that works with python 3.5 doesn't work with other versions.
- Loading branch information
Showing
2 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
# | ||
# Helper script to check that packages defined in a requirements.txt | ||
# file can be installed in different Python versions, it checks by | ||
# default the requirements.txt file for libbeat tests. | ||
# | ||
# Usage: check_python_requirements.sh /path/to/requirements.txt | ||
# | ||
# VERSIONS environment variable can be set to a space-separated list | ||
# of versions of python to test with. | ||
# | ||
|
||
set -e | ||
|
||
function abspath() { | ||
local path=$1 | ||
if [ -d "$path" ]; then | ||
cd "$path"; pwd; cd - > /dev/null | ||
else | ||
echo $(abspath "$(dirname "$path")")/$(basename "$path") | ||
fi | ||
} | ||
|
||
BEATS_PATH=$(abspath "$(dirname "${BASH_SOURCE[0]}")"/..) | ||
|
||
VERSIONS=${VERSIONS:-3.5 3.6 3.7 3.8 3.9-rc} | ||
REQUIREMENTS=${1:-${BEATS_PATH}/libbeat/tests/system/requirements.txt} | ||
|
||
if [ ! -f "$REQUIREMENTS" ]; then | ||
echo "Requirements file doesn't exist: $REQUIREMENTS" | ||
exit -1 | ||
fi | ||
|
||
REQUIREMENTS=$(abspath "$REQUIREMENTS") | ||
|
||
echo "Versions: $VERSIONS" | ||
echo "Requirements file: $REQUIREMENTS" | ||
|
||
for version in $VERSIONS; do | ||
echo "==== Version: $version" | ||
|
||
docker run -it --rm -v "$REQUIREMENTS":/requirements.txt python:$version \ | ||
python -m pip install -q -r /requirements.txt | ||
|
||
echo "==== OK" | ||
done |