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

Commit c2b8c9c

Browse files
author
Matthias Koeppe
committed
Merge #30666
2 parents 419d59f + 1531fda commit c2b8c9c

File tree

232 files changed

+1432
-137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+1432
-137
lines changed

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,26 @@ build/bin/sage-build-env-config
178178
/pkgs/sagemath-categories/setup.cfg
179179
/pkgs/sagemath-environment/setup.cfg
180180
/pkgs/sagemath-repl/setup.cfg
181+
/pkgs/sagemath-flint-arb/setup.cfg
182+
/pkgs/sagemath-gap/setup.cfg
183+
/pkgs/sagemath-giac/setup.cfg
184+
/pkgs/sagemath-homfly/setup.cfg
181185
/pkgs/sagemath-objects/pyproject.toml
182186
/pkgs/sagemath-categories/pyproject.toml
183187
/pkgs/sagemath-environment/pyproject.toml
184188
/pkgs/sagemath-repl/pyproject.toml
189+
/pkgs/sagemath-flint-arb/pyproject.toml
190+
/pkgs/sagemath-gap/pyproject.toml
191+
/pkgs/sagemath-giac/pyproject.toml
192+
/pkgs/sagemath-homfly/pyproject.toml
185193
/pkgs/sagemath-objects/requirements.txt
186194
/pkgs/sagemath-categories/requirements.txt
187195
/pkgs/sagemath-environment/requirements.txt
188196
/pkgs/sagemath-repl/requirements.txt
197+
/pkgs/sagemath-flint-arb/requirements.txt
198+
/pkgs/sagemath-gap/requirements.txt
199+
/pkgs/sagemath-giac/requirements.txt
200+
/pkgs/sagemath-homfly/requirements.txt
189201
/pkgs/sagemath-categories/MANIFEST.in
190202

191203
# same for old locations - before Trac #31577

Makefile

-37
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

+48-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,27 @@ 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+
sagemath_giac \
140+
sagemath_flint_arb \
141+
sagemath_gap \
142+
sagemath_homfly
143+
144+
# sage_docbuild is here, not in PYPI_WHEEL_PACKAGES, because it depends on sagelib
145+
WHEEL_PACKAGES = $(PYPI_WHEEL_PACKAGES) \
146+
sage_conf \
147+
sagelib \
148+
sage_docbuild
149+
150+
# Packages for which build sdists for PyPI
151+
PYPI_SDIST_PACKAGES = $(WHEEL_PACKAGES)
132152

133153
# Generate the actual inst_<pkgname> variables; for each package that is
134154
# actually built this generates a line like:
@@ -198,6 +218,7 @@ SAGE_I_TARGETS = sagelib doc
198218
# Tell make not to look for files with these names:
199219
.PHONY: all all-sage all-toolchain all-build all-sageruntime \
200220
all-start build-start base toolchain toolchain-deps base-toolchain \
221+
pypi-sdists pypi-wheels wheels \
201222
sagelib \
202223
doc doc-html doc-html-jsmath doc-html-mathjax doc-pdf \
203224
doc-uninstall \
@@ -418,6 +439,25 @@ list-broken-packages: auditwheel_or_delocate
418439
echo >&2 "$$fix_broken_packages"; \
419440
fi
420441

442+
pypi-sdists: $(PYPI_SDIST_PACKAGES:%=%-sdist)
443+
@echo "Built sdists are in upstream/"
444+
445+
# Ensuring wheels are present, even for packages that may have been installed
446+
# as editable. Until we have better uninstallation of script packages, we
447+
# just remove the timestamps, which will lead to rebuilds of the packages.
448+
pypi-wheels:
449+
for a in $(PYPI_WHEEL_PACKAGES); do \
450+
rm -f venv/var/lib/sage/installed/$$a-*; \
451+
done
452+
$(MAKE_REC) SAGE_EDITABLE=no SAGE_WHEELS=yes $(PYPI_WHEEL_PACKAGES)
453+
@echo "Built wheels are in venv/var/lib/sage/wheels/"
454+
455+
wheels:
456+
for a in $(WHEEL_PACKAGES); do \
457+
rm -f venv/var/lib/sage/installed/$$a-*; \
458+
done
459+
$(MAKE_REC) SAGE_EDITABLE=no SAGE_WHEELS=yes $(WHEEL_PACKAGES)
460+
@echo "Built wheels are in venv/var/lib/sage/wheels/"
421461

422462
#==============================================================================
423463
# Setting SAGE_CHECK... variables
@@ -711,6 +751,13 @@ $(1)-uninstall: $(1)-$(4)-uninstall
711751

712752
$(1)-clean: $(1)-uninstall
713753

754+
$(1)-sdist: FORCE python_build sage_setup cython
755+
$(AM_V_at) cd '$$(SAGE_ROOT)' && \
756+
. '$$(SAGE_ROOT)/src/bin/sage-src-env-config' && \
757+
. '$$(SAGE_ROOT)/src/bin/sage-env-config' && \
758+
. '$$(SAGE_ROOT)/src/bin/sage-env' && \
759+
'$$(SAGE_ROOT)/build/pkgs/$(1)/spkg-src'
760+
714761
# Recursive tox invocation (note - we do not set the environment here).
715762
# Setting SAGE_SPKG_WHEELS is for the benefit of sagelib's tox.ini
716763
$(1)-tox-%: FORCE

build/pkgs/sage_conf/spkg-src

+4-1
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

+4-1
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

+4-1
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-src

+4-1
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

+6-2
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

+4-1
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

+4-1
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"
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/README.rst
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../sagelib/bootstrap
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$(PYTHON) sagemath_categories flint arb | $(PYTHON_TOOLCHAIN) sage_setup cython pkgconfig
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file is updated on every release by the sage-update-version script
2+
sagemath-flint-arb
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/VERSION.txt
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../sagemath_objects/spkg-install
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Script to prepare an sdist tarball for sagemath-flint-arb
4+
# This script is not used during build.
5+
#
6+
# HOW TO MAKE THE TARBALL:
7+
# ./sage --sh build/pkgs/sagemath_flint_arb/spkg-src
8+
9+
if [ -z "$SAGE_ROOT" ] ; then
10+
echo >&2 "Error - SAGE_ROOT undefined ... exiting"
11+
echo >&2 "Maybe run 'sage -sh'?"
12+
exit 1
13+
fi
14+
15+
# Exit on failure
16+
set -e
17+
18+
cd build/pkgs/sagemath_flint_arb
19+
20+
cd src
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_flint_arb/src

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../pkgs/sagemath-flint-arb

build/pkgs/sagemath_flint_arb/type

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
optional

build/pkgs/sagemath_gap/SPKG.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/README.rst

build/pkgs/sagemath_gap/bootstrap

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../sagelib/bootstrap

build/pkgs/sagemath_gap/dependencies

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$(PYTHON) sagemath_environment sagemath_categories gap | $(PYTHON_TOOLCHAIN) sage_setup cython pkgconfig
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file is updated on every release by the sage-update-version script
2+
sagemath-gap
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/VERSION.txt

build/pkgs/sagemath_gap/spkg-install

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
# From sage-spkg.
3+
# For type=script packages, the build rule in build/make/Makefile sources
4+
# sage-env but not sage-dist-helpers.
5+
lib="$SAGE_ROOT/build/bin/sage-dist-helpers"
6+
source "$lib"
7+
if [ $? -ne 0 ]; then
8+
echo >&2 "Error: failed to source $lib"
9+
echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?"
10+
exit 1
11+
fi
12+
cd src
13+
14+
export PIP_NO_INDEX=true
15+
export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS"
16+
17+
rm -Rf build
18+
# First build the sdist, then build the wheel from the sdist.
19+
# https://pypa-build.readthedocs.io/en/latest/#python--m-build
20+
# (Important because sagemath-objects uses MANIFEST.in for filtering.)
21+
# Do not install the wheel.
22+
DIST_DIR="$(mktemp -d)"
23+
python3 -m build --outdir "$DIST_DIR"/dist . || sdh_die "Failure building sdist and wheel"
24+
ls -l "$DIST_DIR"/dist/*.tar.gz
25+
wheel=$(cd "$DIST_DIR" && sdh_store_wheel . && echo $wheel)
26+
ls -l "$wheel"
27+
28+
if [ "$SAGE_CHECK" != no ]; then
29+
tox -r -v -e sagepython-sagewheels-nopypi-norequirements --installpkg $wheel
30+
fi

build/pkgs/sagemath_gap/spkg-src

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Script to prepare an sdist tarball for sagemath-gap
4+
# This script is not used during build.
5+
#
6+
# HOW TO MAKE THE TARBALL:
7+
# ./sage --sh build/pkgs/sagemath_gap/spkg-src
8+
9+
if [ -z "$SAGE_ROOT" ] ; then
10+
echo >&2 "Error - SAGE_ROOT undefined ... exiting"
11+
echo >&2 "Maybe run 'sage -sh'?"
12+
exit 1
13+
fi
14+
15+
# Exit on failure
16+
set -e
17+
18+
cd build/pkgs/sagemath_gap
19+
20+
cd src
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_gap/src

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../pkgs/sagemath-gap

build/pkgs/sagemath_gap/type

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
optional

build/pkgs/sagemath_giac/SPKG.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/README.rst

build/pkgs/sagemath_giac/bootstrap

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../sagelib/bootstrap

build/pkgs/sagemath_giac/dependencies

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$(PYTHON) sagemath_categories giac | $(PYTHON_TOOLCHAIN) sage_setup cython pkgconfig
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file is updated on every release by the sage-update-version script
2+
sagemath-giac
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/VERSION.txt

build/pkgs/sagemath_giac/spkg-install

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../sagemath_objects/spkg-install

build/pkgs/sagemath_giac/spkg-src

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Script to prepare an sdist tarball for sagemath-giac
4+
# This script is not used during build.
5+
#
6+
# HOW TO MAKE THE TARBALL:
7+
# ./sage --sh build/pkgs/sagemath_giac/spkg-src
8+
9+
if [ -z "$SAGE_ROOT" ] ; then
10+
echo >&2 "Error - SAGE_ROOT undefined ... exiting"
11+
echo >&2 "Maybe run 'sage -sh'?"
12+
exit 1
13+
fi
14+
15+
# Exit on failure
16+
set -e
17+
18+
cd build/pkgs/sagemath_giac
19+
20+
cd src
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_giac/src

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../pkgs/sagemath-giac

build/pkgs/sagemath_giac/type

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
optional

build/pkgs/sagemath_homfly/SPKG.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/README.rst

0 commit comments

Comments
 (0)