56
56
# be given as arguments. If $SAGE_DESTDIR is not set then the command is
57
57
# run with $SAGE_SUDO, if set.
58
58
#
59
- # - sdh_pip_install [...]
59
+ # - sdh_pip_install [--no-deps] [--build-isolation] [ ...]
60
60
#
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.
64
65
# If $SAGE_DESTDIR is not set then the command is run with $SAGE_SUDO, if
65
66
# set.
66
67
#
@@ -240,8 +241,8 @@ sdh_pip_install() {
240
241
echo " Installing $PKG_NAME "
241
242
mkdir -p dist
242
243
rm -f dist/* .whl
244
+ install_options=" "
243
245
# pip has --no-build-isolation but no flag that turns the default back on...
244
- options=" "
245
246
build_isolation_option=" --no-build-isolation --no-binary :all:"
246
247
while [ $# -gt 0 ]; do
247
248
case " $1 " in
@@ -252,19 +253,19 @@ sdh_pip_install() {
252
253
# The SPKG needs to declare "setuptools_wheel" as a dependency.
253
254
build_isolation_option=" --find-links=$SAGE_SPKG_WHEELS "
254
255
;;
255
- -* )
256
- options =" $options $1 "
256
+ --no-deps )
257
+ install_options =" $install_options $1 "
257
258
;;
258
259
* )
259
260
break
260
261
;;
261
262
esac
262
263
shift
263
264
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 " $@ " || \
265
266
sdh_die " Error building a wheel for $PKG_NAME "
266
267
267
- sdh_store_and_pip_install_wheel $options .
268
+ sdh_store_and_pip_install_wheel $install_options .
268
269
}
269
270
270
271
sdh_store_wheel () {
0 commit comments