Skip to content

Commit

Permalink
Fix installation of pip with SAGE_SUDO
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Dec 3, 2023
1 parent 1f0bc9d commit f981b15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/bin/sage-dist-helpers
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ sdh_store_and_pip_install_wheel() {
local sudo=""
local root=""
fi
sdh_actually_pip_install_wheel $distname $root $pip_options -r "$SAGE_SPKG_SCRIPTS/$PKG_BASE/spkg-requirements.txt"
sdh_actually_pip_install_wheel $distname $root $pip_options "$wheel"
fi
echo "sdh_pip_uninstall -r \"\$SAGE_SPKG_SCRIPTS/\$PKG_BASE/spkg-requirements.txt\"" >> "$script_dir"/spkg-piprm
}
Expand All @@ -406,7 +406,7 @@ sdh_actually_pip_install_wheel() {
echo "(ignoring error)" >&2
fi
$sudo sage-pip-install "$@" || \
sdh_die "Error installing $@"
sdh_die "Error installing $distname"
}

sdh_pip_uninstall() {
Expand Down
4 changes: 4 additions & 0 deletions build/pkgs/pip/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ cd src

sdh_setup_bdist_wheel

# pip can install its own wheel! But first we need to ensure that the pip
# source directory in on the PYTHONPATH
export PYTHONPATH="$(pwd)/src"

# --ignore-installed makes sure that pip does not mistake
# its own source tree as an existing installation
sdh_store_and_pip_install_wheel --ignore-installed .

0 comments on commit f981b15

Please sign in to comment.