Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 48576c8

Browse files
author
Matthias Koeppe
committed
build/bin/sage-dist-helpers: Use pip wheel --editable
1 parent 7ad267a commit 48576c8

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

build/bin/sage-dist-helpers

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ sdh_pip_install() {
244244
install_options=""
245245
# pip has --no-build-isolation but no flag that turns the default back on...
246246
build_isolation_option="--find-links=$SAGE_SPKG_WHEELS"
247+
wheel_options=""
247248
while [ $# -gt 0 ]; do
248249
case "$1" in
249250
--build-isolation)
@@ -257,6 +258,9 @@ sdh_pip_install() {
257258
# Use --no-binary, so that no wheels from caches are used.
258259
build_isolation_option="--no-build-isolation --no-binary :all:"
259260
;;
261+
--editable)
262+
wheel_options="$wheel_options $1"
263+
;;
260264
--no-deps)
261265
install_options="$install_options $1"
262266
;;
@@ -266,18 +270,18 @@ sdh_pip_install() {
266270
esac
267271
shift
268272
done
269-
if python3 -m pip wheel --wheel-dir=dist --verbose --no-deps --no-index --isolated --ignore-requires-python $build_isolation_option "$@"; then
273+
if python3 -m pip wheel --wheel-dir=dist --verbose --no-deps --no-index --isolated --ignore-requires-python $build_isolation_option $wheel_options "$@"; then
270274
: # successful
271275
else
272276
case $build_isolation_option in
273-
*--no-build-isolation*)
277+
*--no-build-isolation*|*--editable*)
274278
sdh_die "Error building a wheel for $PKG_NAME"
275279
;;
276280
*)
277281
echo >&2 "Warning: building with \"python3 -m pip wheel --wheel-dir=dist --verbose --no-deps --no-index --isolated --ignore-requires-python $build_isolation_option\" failed."
278282
build_isolation_option="--no-build-isolation --no-binary :all:"
279283
echo >&2 "Retrying with \"python3 -m pip wheel --wheel-dir=dist --verbose --no-deps --no-index --isolated --ignore-requires-python $build_isolation_option\"."
280-
if python3 -m pip wheel --wheel-dir=dist --verbose --no-deps --no-index --isolated --ignore-requires-python $build_isolation_option "$@"; then
284+
if python3 -m pip wheel --wheel-dir=dist --verbose --no-deps --no-index --isolated --ignore-requires-python $build_isolation_option $wheel_options "$@"; then
281285
echo >&2 "Warning: Wheel building needed to use \"$build_isolation_option\" to succeed. This means that a dependencies file in build/pkgs/ needs to be updated. Please report this to [email protected], including the build log of this package."
282286
else
283287
sdh_die "Error building a wheel for $PKG_NAME"
@@ -290,8 +294,7 @@ sdh_pip_install() {
290294

291295
sdh_pip_editable_install() {
292296
echo "Installing $PKG_NAME (editable mode)"
293-
python3 -m pip install --verbose --no-deps --no-index --no-build-isolation --isolated --editable "$@" || \
294-
sdh_die "Error installing $PKG_NAME"
297+
sdh_pip_install --editable "$@"
295298
}
296299

297300
sdh_store_wheel() {

0 commit comments

Comments
 (0)