Skip to content

Commit df5d71a

Browse files
author
Release Manager
committed
gh-35104: Remove direct use of "setup.py sdist", add targets "make SPKG-sdist" <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> ### 📚 Description Fixes #34855 <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If it resolves an open issue, please link to the issue here. For example "Closes #1337" --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] I have made sure that the title is self-explanatory and the description concisely explains the PR. - [x] I have linked an issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open pull requests that this PR logically depends on --> <!-- - #xyz: short description why this is a dependency - #abc: ... --> URL: #35104 Reported by: Matthias Köppe Reviewer(s): John H. Palmieri
2 parents a07e273 + c0f6348 commit df5d71a

File tree

12 files changed

+84
-48
lines changed

12 files changed

+84
-48
lines changed

Makefile

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -80,42 +80,6 @@ download:
8080
dist: build/make/Makefile
8181
./sage --sdist
8282

83-
pypi-sdists: sage_setup
84-
./sage --sh build/pkgs/sage_conf/spkg-src
85-
./sage --sh build/pkgs/sage_sws2rst/spkg-src
86-
./sage --sh build/pkgs/sage_docbuild/spkg-src
87-
./sage --sh build/pkgs/sage_setup/spkg-src
88-
./sage --sh build/pkgs/sagelib/spkg-src
89-
./sage --sh build/pkgs/sagemath_objects/spkg-src
90-
./sage --sh build/pkgs/sagemath_categories/spkg-src
91-
./sage --sh build/pkgs/sagemath_environment/spkg-src
92-
./sage --sh build/pkgs/sagemath_repl/spkg-src
93-
@echo "Built sdists are in upstream/"
94-
95-
# Ensuring wheels are present, even for packages that may have been installed
96-
# as editable. Until we have better uninstallation of script packages, we
97-
# just remove the timestamps, which will lead to rebuilds of the packages.
98-
PYPI_WHEEL_PACKAGES = sage_sws2rst sage_setup sagemath_environment sagemath_objects sagemath_repl sagemath_categories
99-
pypi-wheels:
100-
for a in $(PYPI_WHEEL_PACKAGES); do \
101-
rm -f venv/var/lib/sage/installed/$$a-*; \
102-
done
103-
for a in $(PYPI_WHEEL_PACKAGES); do \
104-
$(MAKE) SAGE_EDITABLE=no SAGE_WHEELS=yes $$a; \
105-
done
106-
@echo "Built wheels are in venv/var/lib/sage/wheels/"
107-
108-
# sage_docbuild is here, not in PYPI_WHEEL_PACKAGES, because it depends on sagelib
109-
WHEEL_PACKAGES = $(PYPI_WHEEL_PACKAGES) sage_conf sagelib sage_docbuild
110-
wheels:
111-
for a in $(WHEEL_PACKAGES); do \
112-
rm -f venv/var/lib/sage/installed/$$a-*; \
113-
done
114-
for a in $(WHEEL_PACKAGES); do \
115-
$(MAKE) SAGE_EDITABLE=no SAGE_WHEELS=yes $$a; \
116-
done
117-
@echo "Built wheels are in venv/var/lib/sage/wheels/"
118-
11983
###############################################################################
12084
# Cleaning up
12185
###############################################################################
@@ -380,7 +344,6 @@ list:
380344
@$(MAKE) --silent -f build/make/Makefile SAGE_PKGCONFIG=dummy $@
381345

382346
.PHONY: default build dist install micro_release \
383-
pypi-sdists pypi-wheels wheels \
384347
misc-clean bdist-clean distclean bootstrap-clean maintainer-clean \
385348
test check testoptional testall testlong testoptionallong testallong \
386349
ptest ptestoptional ptestall ptestlong ptestoptionallong ptestallong \

build/make/Makefile.in

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,23 @@ PIP_PACKAGES = @SAGE_PIP_PACKAGES@
128128
# Packages that use the 'script' package build rules
129129
SCRIPT_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

build/pkgs/sage_conf/spkg-src

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@ fi
1616
set -e
1717

1818
cd pkgs/sage-conf_pypi
19-
python3 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES"
19+
# Get rid of old *.egg-info/SOURCES.txt
20+
rm -Rf *.egg-info
21+
22+
python3 -m build --sdist --no-isolation --skip-dependency-check --outdir "$SAGE_DISTFILES"

build/pkgs/sage_docbuild/spkg-src

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ set -e
1818
cd build/pkgs/sage_docbuild
1919

2020
cd src
21-
python3 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES"
21+
# Get rid of old *.egg-info/SOURCES.txt
22+
rm -Rf *.egg-info
23+
24+
python3 -m build --sdist --no-isolation --skip-dependency-check --outdir "$SAGE_DISTFILES"

build/pkgs/sage_setup/spkg-src

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ set -e
1818
cd build/pkgs/sage_setup
1919

2020
cd src
21-
python3 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES"
21+
# Get rid of old *.egg-info/SOURCES.txt
22+
rm -Rf *.egg-info
23+
24+
python3 -m build --sdist --no-isolation --skip-dependency-check --outdir "$SAGE_DISTFILES"

build/pkgs/sage_sws2rst/spkg-install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ if [ "$SAGE_EDITABLE" = yes ]; then
1818
else
1919
sdh_pip_install .
2020
fi
21+
cd ..
2122
# For type=script packages, spkg-check is not run
2223
case "$SAGE_CHECK" in
2324
yes)

build/pkgs/sage_sws2rst/spkg-src

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ set -e
1818
cd build/pkgs/sage_sws2rst
1919

2020
cd src
21-
python3 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES"
21+
# Get rid of old *.egg-info/SOURCES.txt
22+
rm -Rf *.egg-info
23+
24+
python3 -m build --sdist --no-isolation --skip-dependency-check --outdir "$SAGE_DISTFILES"

build/pkgs/sagelib/spkg-src

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This script is not used during build.
55
#
66
# HOW TO MAKE THE TARBALL:
7-
# ./sage --sh build/pkgs/sagelib/spkg-src
7+
# make python_build && ./sage --sh build/pkgs/sagelib/spkg-src
88

99
if [ -z "$SAGE_ROOT" ] ; then
1010
echo >&2 "Error - SAGE_ROOT undefined ... exiting"
@@ -18,4 +18,8 @@ set -e
1818
cd "$SAGE_ROOT"/build/pkgs/sagelib
1919

2020
cd src
21-
python3 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES"
21+
22+
# Get rid of old *.egg-info/SOURCES.txt
23+
rm -Rf *.egg-info
24+
25+
python3 -m build --sdist --no-isolation --skip-dependency-check --outdir "$SAGE_DISTFILES"

build/pkgs/sagemath_categories/spkg-src

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ set -e
1818
cd build/pkgs/sagemath_categories
1919

2020
cd src
21-
python3 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES"
21+
# Get rid of old *.egg-info/SOURCES.txt
22+
rm -Rf *.egg-info
23+
24+
python3 -m build --sdist --no-isolation --skip-dependency-check --outdir "$SAGE_DISTFILES"

build/pkgs/sagemath_environment/spkg-src

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ set -e
1818
cd build/pkgs/sagemath_environment
1919

2020
cd src
21-
python3 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES"
21+
# Get rid of old *.egg-info/SOURCES.txt
22+
rm -Rf *.egg-info
23+
24+
python3 -m build --sdist --no-isolation --skip-dependency-check --outdir "$SAGE_DISTFILES"

0 commit comments

Comments
 (0)