Skip to content

Commit

Permalink
azure: Don't customize pip's builddir
Browse files Browse the repository at this point in the history
As of 21.3 pip:

> Remove the --build-dir option and aliases, one last time. (pypa/pip#10485)

https://pip.pypa.io/en/stable/news/#v21-3

Previous versions warn about deprecation.

The builddir is provided to pip via env variable PIP_BUILD in Tox task.
The purpose of changing of default builddir was noexec mount option for
/tmp in Travis (see 17d571c). Since Travis is no longer used and
Azure lacks this issue the PIP_BUILD can be safely removed.

Note: pip 21.3 just ignores this env variable, which is more than can be
said for the command line option. It's better to clean it up, since the
behaviour may be changed in future.

This is effectively the revert of 17d571c.

Fixes: https://pagure.io/freeipa/issue/9011
Signed-off-by: Stanislav Levin <[email protected]>
  • Loading branch information
stanislavlevin authored and flo-renaud committed Oct 21, 2021
1 parent 488fb10 commit e650db5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
16 changes: 2 additions & 14 deletions .tox-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ set -ex
FLAVOR="$1"
ENVPYTHON="$(realpath -s "$2")"
ENVSITEPACKAGESDIR="$(realpath -s "$3")"
ENVDIR="$4"
# 4...end are package requirements
shift 4
# 3...end are package requirements
shift 3

TOXINIDIR="$(cd "$(dirname "$0")" && pwd)"

Expand All @@ -26,21 +25,10 @@ if [ ! -f "${TOXINIDIR}/tox.ini" ]; then
exit 3
fi

if [ ! -d "${ENVDIR}" ]; then
echo "${ENVDIR}: no such directory"
exit 4
fi

# https://pip.pypa.io/en/stable/user_guide/#environment-variables
export PIP_CACHE_DIR="${TOXINIDIR}/.tox/cache"
mkdir -p "${PIP_CACHE_DIR}"

# /tmp could be mounted with noexec option.
# pip checks if path is executable and if not then doesn't set such
# permission bits
export PIP_BUILD="${ENVDIR}/pip_build"
rm -rf "${PIP_BUILD}"

DISTBUNDLE="${TOXINIDIR}/dist/bundle"
mkdir -p "${DISTBUNDLE}"

Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ skipsdist=true
# always re-create virtual env. A special install helper is used to configure,
# build and install packages.
recreate=True
install_command={toxinidir}/.tox-install.sh wheel_bundle {envpython} {envsitepackagesdir} {envdir} {packages}
install_command={toxinidir}/.tox-install.sh wheel_bundle {envpython} {envsitepackagesdir} {packages}
changedir={envdir}
setenv=
HOME={envtmpdir}
Expand All @@ -34,7 +34,7 @@ commands=

[testenv:pypi]
recreate=True
install_command={toxinidir}/.tox-install.sh pypi_packages {envpython} {envsitepackagesdir} {envdir} {packages}
install_command={toxinidir}/.tox-install.sh pypi_packages {envpython} {envsitepackagesdir} {packages}
changedir={envdir}
setenv=
HOME={envtmpdir}
Expand Down

0 comments on commit e650db5

Please sign in to comment.