@@ -128,7 +128,23 @@ PIP_PACKAGES = @SAGE_PIP_PACKAGES@
128128# Packages that use the 'script' package build rules
129129SCRIPT_PACKAGES = @SAGE_SCRIPT_PACKAGES@
130130
131-
131+ # Packages for which we build wheels for PyPI
132+ PYPI_WHEEL_PACKAGES = \
133+ sage_sws2rst \
134+ sage_setup \
135+ sagemath_environment \
136+ sagemath_objects \
137+ sagemath_repl \
138+ sagemath_categories
139+
140+ # sage_docbuild is here, not in PYPI_WHEEL_PACKAGES, because it depends on sagelib
141+ WHEEL_PACKAGES = $(PYPI_WHEEL_PACKAGES ) \
142+ sage_conf \
143+ sagelib \
144+ sage_docbuild
145+
146+ # Packages for which build sdists for PyPI
147+ PYPI_SDIST_PACKAGES = $(WHEEL_PACKAGES )
132148
133149# Generate the actual inst_<pkgname> variables; for each package that is
134150# actually built this generates a line like:
@@ -198,6 +214,7 @@ SAGE_I_TARGETS = sagelib doc
198214# Tell make not to look for files with these names:
199215.PHONY : all all-sage all-toolchain all-build all-sageruntime \
200216 all-start build-start base toolchain toolchain-deps base-toolchain \
217+ pypi-sdists pypi-wheels wheels \
201218 sagelib \
202219 doc doc-html doc-html-jsmath doc-html-mathjax doc-pdf \
203220 doc-uninstall \
@@ -418,6 +435,25 @@ list-broken-packages: auditwheel_or_delocate
418435 echo >&2 " $$ fix_broken_packages" ; \
419436 fi
420437
438+ pypi-sdists : $(PYPI_SDIST_PACKAGES:%=%-sdist )
439+ @echo " Built sdists are in upstream/"
440+
441+ # Ensuring wheels are present, even for packages that may have been installed
442+ # as editable. Until we have better uninstallation of script packages, we
443+ # just remove the timestamps, which will lead to rebuilds of the packages.
444+ pypi-wheels :
445+ for a in $( PYPI_WHEEL_PACKAGES) ; do \
446+ rm -f $(SAGE_VENV ) /var/lib/sage/installed/$$ a-* ; \
447+ done
448+ $(MAKE_REC ) SAGE_EDITABLE=no SAGE_WHEELS=yes $(PYPI_WHEEL_PACKAGES )
449+ @echo " Built wheels are in venv/var/lib/sage/wheels/"
450+
451+ wheels :
452+ for a in $( WHEEL_PACKAGES) ; do \
453+ rm -f $(SAGE_VENV ) /var/lib/sage/installed/$$ a-* ; \
454+ done
455+ $(MAKE_REC ) SAGE_EDITABLE=no SAGE_WHEELS=yes $(WHEEL_PACKAGES )
456+ @echo " Built wheels are in venv/var/lib/sage/wheels/"
421457
422458# ==============================================================================
423459# Setting SAGE_CHECK... variables
@@ -711,6 +747,13 @@ $(1)-uninstall: $(1)-$(4)-uninstall
711747
712748$(1 ) -clean: $(1 ) -uninstall
713749
750+ $(1 ) -sdist: FORCE python_build sage_setup cython
751+ $(AM_V_at ) cd '$$(SAGE_ROOT ) ' && \
752+ . '$$(SAGE_ROOT ) /src/bin/sage-src-env-config' && \
753+ . '$$(SAGE_ROOT ) /src/bin/sage-env-config' && \
754+ . '$$(SAGE_ROOT ) /src/bin/sage-env' && \
755+ '$$(SAGE_ROOT ) /build/pkgs/$(1 ) /spkg-src'
756+
714757# Recursive tox invocation (note - we do not set the environment here).
715758# Setting SAGE_SPKG_WHEELS is for the benefit of sagelib's tox.ini
716759$(1 ) -tox-%: FORCE
0 commit comments