Skip to content

Commit 8f3bd8f

Browse files
author
Matthias Koeppe
committed
build/bin/sage-dist-helpers: Only extract special ooptions --build-isolation and --no-deps from the front, pass --no-deps only to install
1 parent fd91cb6 commit 8f3bd8f

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

build/bin/sage-dist-helpers

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@
5656
# be given as arguments. If $SAGE_DESTDIR is not set then the command is
5757
# run with $SAGE_SUDO, if set.
5858
#
59-
# - sdh_pip_install [...]
59+
# - sdh_pip_install [--no-deps] [--build-isolation] [...]
6060
#
61-
# Runs `pip install` with the given arguments, as well as additional
62-
# default arguments used for installing packages into Sage with pip.
63-
# Currently this is just a wrapper around the `sage-pip-install` command.
61+
# Builds a wheel using `pip wheel` with the given options [...], then installs
62+
# the wheel. Unless the special option --build-isolation is given,
63+
# the wheel is built using the option --no-build-isolation.
64+
# If the special option --no-deps is given, it is passed to pip install.
6465
# If $SAGE_DESTDIR is not set then the command is run with $SAGE_SUDO, if
6566
# set.
6667
#
@@ -240,8 +241,8 @@ sdh_pip_install() {
240241
echo "Installing $PKG_NAME"
241242
mkdir -p dist
242243
rm -f dist/*.whl
244+
install_options=""
243245
# pip has --no-build-isolation but no flag that turns the default back on...
244-
options=""
245246
build_isolation_option="--no-build-isolation --no-binary :all:"
246247
while [ $# -gt 0 ]; do
247248
case "$1" in
@@ -252,19 +253,19 @@ sdh_pip_install() {
252253
# The SPKG needs to declare "setuptools_wheel" as a dependency.
253254
build_isolation_option="--find-links=$SAGE_SPKG_WHEELS"
254255
;;
255-
-*)
256-
options="$options $1"
256+
--no-deps)
257+
install_options="$install_options $1"
257258
;;
258259
*)
259260
break
260261
;;
261262
esac
262263
shift
263264
done
264-
python3 -m pip wheel --use-feature=in-tree-build --wheel-dir=dist --verbose --no-deps --no-index --isolated --ignore-requires-python $options $build_isolation_option "$@" || \
265+
python3 -m pip wheel --use-feature=in-tree-build --wheel-dir=dist --verbose --no-deps --no-index --isolated --ignore-requires-python $build_isolation_option "$@" || \
265266
sdh_die "Error building a wheel for $PKG_NAME"
266267

267-
sdh_store_and_pip_install_wheel $options .
268+
sdh_store_and_pip_install_wheel $install_options .
268269
}
269270

270271
sdh_store_wheel() {

0 commit comments

Comments
 (0)