freeze_packages: restrict some requirements files to source-only pkgs
This commit is contained in:
@@ -20,13 +20,15 @@ which virtualenv > /dev/null 2>&1 || { echo "Please install virtualenv" && exit
|
|||||||
|
|
||||||
${SYSTEM_PYTHON} -m hashin -h > /dev/null 2>&1 || { ${SYSTEM_PYTHON} -m pip install hashin; }
|
${SYSTEM_PYTHON} -m hashin -h > /dev/null 2>&1 || { ${SYSTEM_PYTHON} -m pip install hashin; }
|
||||||
|
|
||||||
for i in '' '-hw' '-binaries' '-binaries-mac' '-build-wine' '-build-mac' '-build-base' '-build-appimage' '-build-android'; do
|
for suffix in '' '-hw' '-binaries' '-binaries-mac' '-build-wine' '-build-mac' '-build-base' '-build-appimage' '-build-android'; do
|
||||||
|
reqfile="requirements${suffix}.txt"
|
||||||
|
|
||||||
rm -rf "$venv_dir"
|
rm -rf "$venv_dir"
|
||||||
virtualenv -p ${SYSTEM_PYTHON} $venv_dir
|
virtualenv -p ${SYSTEM_PYTHON} $venv_dir
|
||||||
|
|
||||||
source $venv_dir/bin/activate
|
source $venv_dir/bin/activate
|
||||||
|
|
||||||
echo "Installing dependencies... (requirements${i}.txt)"
|
echo "Installing dependencies... (${reqfile})"
|
||||||
|
|
||||||
# We pin all python packaging tools (pip and friends). Some of our dependencies might
|
# We pin all python packaging tools (pip and friends). Some of our dependencies might
|
||||||
# pull some of them in (e.g. protobuf->setuptools), and all transitive dependencies
|
# pull some of them in (e.g. protobuf->setuptools), and all transitive dependencies
|
||||||
@@ -34,7 +36,7 @@ for i in '' '-hw' '-binaries' '-binaries-mac' '-build-wine' '-build-mac' '-build
|
|||||||
# that we should explicitly install them now, so that we pin latest versions if possible.
|
# that we should explicitly install them now, so that we pin latest versions if possible.
|
||||||
python -m pip install --upgrade pip setuptools wheel
|
python -m pip install --upgrade pip setuptools wheel
|
||||||
|
|
||||||
python -m pip install -r "$contrib/requirements/requirements${i}.txt" --upgrade
|
python -m pip install -r "$contrib/requirements/${reqfile}" --upgrade
|
||||||
|
|
||||||
echo "OK."
|
echo "OK."
|
||||||
|
|
||||||
@@ -42,13 +44,26 @@ for i in '' '-hw' '-binaries' '-binaries-mac' '-build-wine' '-build-mac' '-build
|
|||||||
restricted=$(echo $requirements | ${SYSTEM_PYTHON} $contrib/deterministic-build/find_restricted_dependencies.py)
|
restricted=$(echo $requirements | ${SYSTEM_PYTHON} $contrib/deterministic-build/find_restricted_dependencies.py)
|
||||||
requirements="$requirements $restricted"
|
requirements="$requirements $restricted"
|
||||||
|
|
||||||
echo "Generating package hashes... (requirements${i}.txt)"
|
echo "Generating package hashes... (${reqfile})"
|
||||||
rm "$contrib/deterministic-build/requirements${i}.txt"
|
rm "$contrib/deterministic-build/${reqfile}"
|
||||||
touch "$contrib/deterministic-build/requirements${i}.txt"
|
touch "$contrib/deterministic-build/${reqfile}"
|
||||||
|
|
||||||
|
# restrict ourselves to source-only packages.
|
||||||
|
# TODO expand this to all reqfiles...
|
||||||
|
HASHIN_FLAGS=""
|
||||||
|
if [[
|
||||||
|
"${suffix}" == "" ||
|
||||||
|
"${suffix}" == "-build-wine" ||
|
||||||
|
"${suffix}" == "-build-mac" ||
|
||||||
|
"${suffix}" == "-build-appimage"
|
||||||
|
]] ;
|
||||||
|
then
|
||||||
|
HASHIN_FLAGS="--python-version source"
|
||||||
|
fi
|
||||||
|
|
||||||
for requirement in $requirements; do
|
for requirement in $requirements; do
|
||||||
echo -e "\r Hashing $requirement..."
|
echo -e "\r Hashing $requirement..."
|
||||||
${SYSTEM_PYTHON} -m hashin -r "$contrib/deterministic-build/requirements${i}.txt" "${requirement}"
|
${SYSTEM_PYTHON} -m hashin $HASHIN_FLAGS -r "$contrib/deterministic-build/${reqfile}" "${requirement}"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "OK."
|
echo "OK."
|
||||||
|
|||||||
Reference in New Issue
Block a user