-
-
Notifications
You must be signed in to change notification settings - Fork 452
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #33817: GH Actions: Add test of the modularized distributions
... as part of the workflow `build.yml`. This is to catch modularization regressions on tickets. To this end, we extend `build/pkgs/sagemath-{objects,categories,environment,repl}/spkg-install` scripts so that they build and store wheels in `SAGE_SPKG_WHEELS` (but do not install them!), and then run `tox` on the wheels (unless disabled by setting `SAGE_CHECK=no`). A new top-level make target `pypi-wheels` runs these scripts for these and other small distribution packages, ensuring that wheels are present even if `configure --enable-editable` is in use. Another top-level make target `wheels` does the same but also includes `sage_conf` and `sagemath_standard`. This is useful for venv installs and helps with the problem noted in #32913. We also extend the script `src/bin/sage-update-version` so that it automatically updates the `install-requires.txt` files for our distribution packages. URL: https://trac.sagemath.org/33817 Reported by: mkoeppe Ticket author(s): Matthias Koeppe Reviewer(s): Tobias Diez, Kwankyu Lee
- Loading branch information
Showing
28 changed files
with
205 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
python_build: A simple, correct PEP517 package builder | ||
====================================================== | ||
|
||
Description | ||
----------- | ||
|
||
``build`` is a simple, correct PEP517 package builder | ||
|
||
License | ||
------- | ||
|
||
MIT | ||
|
||
Upstream Contact | ||
---------------- | ||
|
||
https://pypi.org/project/build/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
$(PYTHON) pyparsing tomli packaging | $(PYTHON_TOOLCHAIN) | ||
|
||
---------- | ||
All lines of this file are ignored except the first. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
optional |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
sage-conf ~= 9.7.b3 | ||
# This file is updated on every release by the sage-update-version script | ||
sage-conf ~= 9.7b6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
sage_docbuild | ||
# This file is updated on every release by the sage-update-version script | ||
sage-docbuild ~= 9.7b6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
sage-setup ~= 9.7.b3 | ||
# This file is updated on every release by the sage-update-version script | ||
sage-setup ~= 9.7b6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
sage_sws2rst | ||
# This file is updated on every release by the sage-update-version script | ||
sage-sws2rst ~= 9.7b6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
sagemath-standard | ||
# This file is updated on every release by the sage-update-version script | ||
sagelib ~= 9.7b6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
sagemath-categories ~= 9.5b6 | ||
# This file is updated on every release by the sage-update-version script | ||
sagemath-categories ~= 9.7b6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
sagemath-environment == 9.6rc3.post2 | ||
# This file is updated on every release by the sage-update-version script | ||
sagemath-environment ~= 9.7b6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FORCE $(PYTHON) cysignals gmpy2 ipython | $(PYTHON_TOOLCHAIN) cython pkgconfig | ||
FORCE $(PYTHON) cysignals gmpy2 ipython | $(PYTHON_TOOLCHAIN) sage_setup cython pkgconfig python_build | ||
|
||
# FORCE: Always run the spkg-install script | ||
# ipython - for the doctester |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Pinned in Trac #29941 until proper namespace packages are supported in #28925. | ||
sagemath-objects == 9.6rc3.post4 | ||
# This file is updated on every release by the sage-update-version script | ||
sagemath-objects ~= 9.7b6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,33 @@ | ||
#!/usr/bin/env bash | ||
# From sage-spkg. | ||
# For type=script packages, the build rule in build/make/Makefile sources | ||
# sage-env but not sage-dist-helpers. | ||
lib="$SAGE_ROOT/build/bin/sage-dist-helpers" | ||
source "$lib" | ||
if [ $? -ne 0 ]; then | ||
echo >&2 "Error: failed to source $lib" | ||
echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" | ||
exit 1 | ||
fi | ||
cd src | ||
|
||
export PIP_NO_INDEX=true | ||
export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS" | ||
|
||
# First build the sdist, then build the wheel from the sdist. | ||
# https://pypa-build.readthedocs.io/en/latest/#python--m-build | ||
# (Important because sagemath-objects uses MANIFEST.in for filtering.) | ||
# Do not install the wheel. | ||
DIST_DIR="$(mktemp -d)" | ||
if ! python3 -m build --outdir "$DIST_DIR"/dist .; then | ||
# This happens on Debian without python3-venv installed - "ensurepip" is missing | ||
echo "Falling back to --no-isolation" | ||
python3 -m build --no-isolation --outdir "$DIST_DIR"/dist . || sdh_die "Failure building sdist and wheel" | ||
fi | ||
|
||
wheel=$(cd "$DIST_DIR" && sdh_store_wheel . && echo $wheel) | ||
ls -l "$wheel" | ||
|
||
if [ "$SAGE_CHECK" != no ]; then | ||
tox | ||
tox -v -e sagepython-norequirements --installpkg "$wheel" | ||
fi | ||
# We skip the install for now. | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
tox | ||
tox >= 3.21.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,41 @@ | ||
# To build and test in the tox environment: | ||
# | ||
# ./sage -sh -c '(cd pkgs/sagemath-environment && tox -v -v)' | ||
# ./sage -sh -c '(cd pkgs/sagemath-environment && tox -v -v -e sagepython)' | ||
# | ||
# To test interactively: | ||
# | ||
# pkgs/sagemath-environment/.tox/python/bin/python | ||
# pkgs/sagemath-environment/.tox/sagepython/bin/python | ||
# | ||
[tox] | ||
envlist = | ||
sagepython-norequirements | ||
|
||
isolated_build = True | ||
|
||
[testenv] | ||
deps = -rrequirements.txt | ||
deps = | ||
!norequirements: -rrequirements.txt | ||
|
||
setenv = | ||
# Sage scripts such as sage-runtests like to use $HOME/.sage | ||
HOME={envdir} | ||
|
||
passenv = | ||
SAGE_NUM_THREADS | ||
SAGE_NUM_THREADS_PARALLEL | ||
# Parallel build | ||
SAGE_NUM_THREADS | ||
SAGE_NUM_THREADS_PARALLEL | ||
# SAGE_VENV only for referring to the basepython | ||
sagepython: SAGE_VENV | ||
|
||
whitelist_externals = | ||
bash | ||
|
||
commands = | ||
# Beware of the treacherous non-src layout. "./sage/" shadows the installed sage package. | ||
python -c 'import sys; "" in sys.path and sys.path.remove(""); from sage.features.all import all_features; print(sorted(all_features(), key=lambda x: x.name)); import sage.misc.package' | ||
{envpython} -c 'import sys; "" in sys.path and sys.path.remove(""); from sage.features.all import all_features; print(sorted(all_features(), key=lambda x: x.name)); import sage.misc.package' | ||
|
||
[testenv:sagepython] | ||
passenv = | ||
SAGE_VENV | ||
basepython = {env:SAGE_VENV}/bin/python3 | ||
|
||
[testenv:sagepython-norequirements] | ||
basepython = {env:SAGE_VENV}/bin/python3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.