From 9750195b6f71ff414c06576a66708b3fbd21365c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 25 Sep 2020 07:23:53 -0700 Subject: [PATCH] WIP: Install pip packages with sage-spkg --- build/bin/sage-dist-helpers | 7 ++++--- build/make/Makefile.in | 31 ++----------------------------- 2 files changed, 6 insertions(+), 32 deletions(-) diff --git a/build/bin/sage-dist-helpers b/build/bin/sage-dist-helpers index 2513beb4c41..7907ed5ecca 100644 --- a/build/bin/sage-dist-helpers +++ b/build/bin/sage-dist-helpers @@ -208,9 +208,10 @@ sdh_pip_install() { else local sudo="$SAGE_SUDO" fi - $sudo sage-pip-uninstall "$@" || \ - sdh_die "Error uninstalling a previous version of $PKG_NAME" - + if [ "$*" = "." ]; then + $sudo sage-pip-uninstall "$@" || \ + sdh_die "Error uninstalling a previous version of $PKG_NAME" + fi mkdir -p dist rm -f dist/*.whl sage-python23 -m pip wheel --wheel-dir=dist --no-binary :all: --verbose --no-deps --no-index --isolated --no-build-isolation "$@" || \ diff --git a/build/make/Makefile.in b/build/make/Makefile.in index bf6d8437dc4..db3246faea3 100644 --- a/build/make/Makefile.in +++ b/build/make/Makefile.in @@ -513,35 +513,8 @@ debug-check: @echo $(foreach pkgname, $(NORMAL_PACKAGES), SAGE_CHECK_$(pkgname) = $(SAGE_CHECK_$(pkgname))) # ================================ pip packages =============================== -# Generate build rules for 'pip' packages; this template is used to generate -# two rules in the form: -# -# : -# $(AM_V_at)sage-logger -p 'sage --pip install ...' '$(SAGE_LOGS)/.log' -# -# -uninstall: -# -sage --pip uninstall -y ... - -# Positional arguments: -# $(1): package name -# $(2): package dependencies -define PIP_PACKAGE_templ -$(1)-build-deps: $(2) - -$(1): $(2) - +$(MAKE_REC) $(1)-no-deps - -$(1)-no-deps: - $(AM_V_at)sage-logger -p 'sage --pip install -r "$$(SAGE_ROOT)/build/pkgs/$(1)/requirements.txt"' '$$(SAGE_LOGS)/$(1).log' - -$(1)-uninstall: - -sage --pip uninstall -y -r '$$(SAGE_ROOT)/build/pkgs/$(1)/requirements.txt' - -.PHONY: $(1) $(1)-clean $(1)-uninstall $(1)-build-deps $(1)-no-deps -endef - $(foreach pkgname,$(PIP_PACKAGES),\ - $(eval $(call PIP_PACKAGE_templ,$(pkgname),$(call pkg_deps,$(pkgname))))) + $(eval $(call NORMAL_PACKAGE_templ,$(pkgname),$(vers_$(pkgname)),$(call pkg_deps,$(pkgname))))) $(foreach pkgname, $(PIP_PACKAGES),\ $(eval $(call NORMAL_PACKAGE_clean_templ,$(pkgname),$(vers_$(pkgname)),\ $(call pkg_deps,$(pkgname))))) @@ -549,7 +522,7 @@ $(foreach pkgname, $(PIP_PACKAGES),\ ifdef DEBUG_RULES $(info # Rules for pip packages) $(foreach pkgname,$(PIP_PACKAGES),\ - $(info $(call PIP_PACKAGE_templ,$(pkgname),$(call pkg_deps,$(pkgname))))) + $(info $(call NORMAL_PACKAGE_templ,$(pkgname),$(vers_$(pkgname)),$(call pkg_deps,$(pkgname))))) endif # ============================= script packages ==============================