This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build/bin/sage-dist-helpers (sdh_pip_uninstall): Use build/bin/sage-p…
…ip-uninstall, resurrected in simplified form
- Loading branch information
Matthias Koeppe
committed
Oct 10, 2021
1 parent
52915b6
commit 2d852ad
Showing
2 changed files
with
24 additions
and
5 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,23 @@ | ||
#!/usr/bin/env bash | ||
# This command ensures that any previous installations of the same package | ||
# are uninstalled. | ||
|
||
# Note: "sage-pip-uninstall" is meant to be run after $(PYTHON) has | ||
# been installed (either as an spkg or as a venv over a system python3). | ||
# It is then guaranteed by sage-env that PATH is set in a way that "python3" | ||
# refers to the correct python3. | ||
PYTHON=python3 | ||
|
||
# The PIP variable is only used to determine the name of the lock file. | ||
PIP=pip3 | ||
|
||
# We should avoid running pip while uninstalling a package because that | ||
# is prone to race conditions. Therefore, we use a lockfile while | ||
# running pip. This is implemented in the Python script sage-flock | ||
LOCK="$SAGE_LOCAL/var/lock/$PIP.lock" | ||
|
||
# --disable-pip-version-check: Don't periodically check PyPI to determine whether a new version of pip is available | ||
# --no-input: Disable prompting for input. | ||
# --yes: Don't ask for confirmation of uninstall deletions | ||
# See sage-pip-install for a discussion of the other flags. | ||
sage-flock -x $LOCK $PYTHON -m pip uninstall --isolated --disable-pip-version-check --yes --no-input "$@" |