Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into sage_symbolic_mo…
Browse files Browse the repository at this point in the history
…dularization_fixes
  • Loading branch information
Matthias Koeppe committed Jun 29, 2023
2 parents dcaba14 + 3230f00 commit 2eb00e8
Show file tree
Hide file tree
Showing 618 changed files with 12,483 additions and 9,615 deletions.
101 changes: 67 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,50 +32,82 @@ jobs:
id: checkout
uses: actions/checkout@v3

- name: Prepare
- name: Update system packages
id: prepare
run: |
# Install test tools.
if apt-get update && apt-get install -y git python3-venv; then
# Debian-specific temporary code:
# Installation of python3-venv can be removed as soon as a
# base image with a release including #33822 is available
:
else
export PATH="build/bin:$PATH"
eval $(sage-print-system-package-command auto update)
eval $(sage-print-system-package-command auto --spkg --yes --no-install-recommends install git)
fi
# Reuse built SAGE_LOCAL contained in the Docker image
./bootstrap
./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv --enable-editable --enable-download-from-upstream-url
export PATH="build/bin:$PATH"
eval $(sage-print-system-package-command auto update)
eval $(sage-print-system-package-command auto --spkg --yes --no-install-recommends install git)
- name: Add prebuilt tree as a worktree
id: worktree
run: |
set -ex
git config --global user.email "[email protected]"
git config --global user.name "Build & Test workflow"
git config --global --add safe.directory $(pwd)
# If actions/checkout downloaded our source tree using the GitHub REST API
# instead of with git (because do not have git installed in our image),
# we first make the source tree a repo.
if [ ! -d .git ]; then git init && git add -A && git commit --quiet -m "new"; fi
# Tag this state of the source tree "new". This is what we want to build and test.
git tag -f new
# Our container image contains a source tree in /sage with a full build of Sage.
# But /sage is not a git repository.
# We make /sage a worktree whose index is at tag "new".
# We then commit the current sources and set the tag "old". (This keeps all mtimes unchanged.)
# Then we update worktree and index with "git reset --hard new".
# (This keeps mtimes of unchanged files unchanged and mtimes of changed files newer than unchanged files.)
# Finally we reset the index to "old". (This keeps all mtimes unchanged.)
# The changed files now show up as uncommitted changes.
git worktree add --detach worktree-image
rm -rf /sage/.git && mv worktree-image/.git /sage/
rm -rf worktree-image && ln -s /sage worktree-image
if [ ! -f worktree-image/.gitignore ]; then cp .gitignore worktree-image/; fi
(cd worktree-image && git add -A && git commit --allow-empty -m "old" -a && git tag -f old && git reset --hard new && git reset old)
- name: Incremental build, test changed files (sage -t --new)
id: incremental
run: |
# Now re-bootstrap and build. The build is incremental because we were careful with the timestamps.
# We run tests with "sage -t --new"; this only tests the uncommitted changes.
./bootstrap && make build && ./sage -t --new -p2
working-directory: ./worktree-image
env:
MAKE: make -j2
SAGE_NUM_THREADS: 2

- name: Build and test modularized distributions
if: always() && steps.prepare.outcome == 'success'
if: always() && steps.worktree.outcome == 'success'
run: make V=0 tox && make pypi-wheels
working-directory: ./worktree-image
env:
MAKE: make -j2
SAGE_NUM_THREADS: 2

- name: Set up node to install pyright
if: always() && steps.prepare.outcome == 'success'
if: always() && steps.worktree.outcome == 'success'
uses: actions/setup-node@v3
with:
node-version: '12'

- name: Install pyright
if: always() && steps.prepare.outcome == 'success'
if: always() && steps.worktree.outcome == 'success'
# Fix to v232 due to bug https://github.com/microsoft/pyright/issues/3239
run: npm install -g [email protected]

- name: Static code check with pyright
if: always() && steps.prepare.outcome == 'success'
run: pyright

- name: Build
if: always() && steps.worktree.outcome == 'success'
run: pyright
working-directory: ./worktree-image

- name: Build (fallback to non-incremental)
id: build
if: always() && steps.prepare.outcome == 'success'
run: make build
if: always() && steps.worktree.outcome == 'success' && steps.incremental.outcome != 'success'
run: |
set -ex
./bootstrap && make doc-clean doc-uninstall sagelib-clean && git clean -fx src/sage && ./config.status && make build
working-directory: ./worktree-image
env:
MAKE: make -j2
SAGE_NUM_THREADS: 2
Expand All @@ -85,27 +117,28 @@ jobs:
run: |
../sage -python -m pip install coverage pytest-xdist
../sage -python -m coverage run -m pytest -c tox.ini --doctest-modules || true
working-directory: ./src
working-directory: ./worktree-image/src
env:
# Increase the length of the lines in the "short summary"
COLUMNS: 120

- name: Test
if: always() && steps.build.outcome == 'success'
- name: Test all files (sage -t --all --long)
if: always() && (steps.incremental.outcome == 'success' || steps.build.outcome == 'success')
run: |
../sage -python -m pip install coverage
../sage -python -m coverage run ./bin/sage-runtests --all -p2 --random-seed=286735480429121101562228604801325644303
working-directory: ./src
../sage -python -m coverage run ./bin/sage-runtests --all --long -p2 --random-seed=286735480429121101562228604801325644303
working-directory: ./worktree-image/src

- name: Prepare coverage results
if: always() && steps.build.outcome == 'success'
if: always() && (steps.incremental.outcome == 'success' || steps.build.outcome == 'success')
run: |
./venv/bin/python3 -m coverage combine src/.coverage/
./venv/bin/python3 -m coverage xml
find . -name *coverage*
working-directory: ./worktree-image

- name: Upload coverage to codecov
if: always() && steps.build.outcome == 'success'
if: always() && (steps.incremental.outcome == 'success' || steps.build.outcome == 'success')
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
files: ./worktree-image/coverage.xml
80 changes: 72 additions & 8 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,94 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Prepare
- name: Update system packages
run: |
apt-get update && apt-get install -y zip
# Reuse built SAGE_LOCAL contained in the Docker image
./bootstrap
./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv --enable-download-from-upstream-url
apt-get update && apt-get install -y git zip
- name: Build
run: make doc-html
- name: Add prebuilt tree as a worktree
id: worktree
run: |
set -ex
git config --global user.email "[email protected]"
git config --global user.name "Build & Test workflow"
git config --global --add safe.directory $(pwd)
# If actions/checkout downloaded our source tree using the GitHub REST API
# instead of with git (because do not have git installed in our image),
# we first make the source tree a repo.
if [ ! -d .git ]; then git init && git add -A && git commit --quiet -m "new"; fi
# Tag this state of the source tree "new". This is what we want to build and test.
git tag -f new
# Our container image contains a source tree in /sage with a full build of Sage.
# But /sage is not a git repository.
# We make /sage a worktree whose index is at tag "new".
# We then commit the current sources and set the tag "old". (This keeps all mtimes unchanged.)
# Then we update worktree and index with "git reset --hard new".
# (This keeps mtimes of unchanged files unchanged and mtimes of changed files newer than unchanged files.)
# Finally we reset the index to "old". (This keeps all mtimes unchanged.)
# The changed files now show up as uncommitted changes.
git worktree add --detach worktree-image
rm -rf /sage/.git && mv worktree-image/.git /sage/
rm -rf worktree-image && ln -s /sage worktree-image
if [ ! -f worktree-image/.gitignore ]; then cp .gitignore worktree-image/; fi
(cd worktree-image && git add -A && git commit --allow-empty -m "old" -a && git tag -f old && git reset --hard new && git reset old)
# Keep track of changes to built HTML
(cd /sage/local/share/doc/sage/html/en && find . -name "*.html" | xargs sed -i '/class="sidebar-brand-text"/s/Sage [0-9a-z.]* /Sage dev /'; git init && (echo ".buildinfo"; echo ".inv") > .gitignore; git add -A && git commit --quiet -m "old")
- name: Incremental build
id: incremental
run: |
# Now re-bootstrap and build. The build is incremental because we were careful with the timestamps.
./bootstrap && make build
working-directory: ./worktree-image
env:
MAKE: make -j2
SAGE_NUM_THREADS: 2

- name: Build (fallback to non-incremental)
id: build
if: always() && steps.worktree.outcome == 'success' && steps.incremental.outcome != 'success'
run: |
set -ex
make doc-clean doc-uninstall sagelib-clean && git clean -fx src/sage && ./config.status && make build
working-directory: ./worktree-image
env:
MAKE: make -j2
SAGE_NUM_THREADS: 2

- name: Build docs
id: docbuild
if: always() && (steps.incremental.outcome == 'success' || steps.build.outcome == 'success')
# Always non-incremental because of the concern that
# incremental docbuild may introduce broken links (inter-file references) though build succeeds
run: |
set -ex
make doc-clean doc-uninstall sagelib-clean && git clean -fx src/sage && ./config.status && make doc-html
working-directory: ./worktree-image
env:
MAKE: make -j2
SAGE_NUM_THREADS: 2

- name: Copy docs
id: copy
if: always() && steps.docbuild.outcome == 'success'
run: |
set -ex
mkdir -p ./docs
# Create changelog
echo '## Preview of CHANGES.html'
(cd /sage/local/share/doc/sage/html/en && find . -name "*.html" | xargs sed -i '/class="sidebar-brand-text"/s/Sage [0-9a-z.]* /Sage dev /'; git diff --name-only) | tee ./docs/CHANGES.txt
(cd /sage/local/share/doc/sage/html/en && git diff; rm -rf .git) > ./docs/html.diff
echo '## Preview of html.diff'; head -n 400 ./docs/html.diff
(echo '<p><a href="html.diff">HTML diff</a>'; sed -E 's,(.*),<p><a href="\1">\1</a>,' ./docs/CHANGES.txt) > ./docs/CHANGES.html
# For some reason the deploy step below cannot find /sage/...
# So copy everything from there to local folder
# We also need to replace the symlinks because netlify is not following them
mkdir -p ./docs
cp -r -L /sage/local/share/doc/sage/html/en/* ./docs
# Zip everything for increased performance
zip -r docs.zip docs
- name: Upload docs
if: always() && steps.copy.outcome == 'success'
uses: actions/upload-artifact@v3
with:
name: docs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/doc-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ jobs:
header: preview-comment
recreate: true
message: |
[Documentation preview for this PR](${{ steps.deploy-netlify.outputs.NETLIFY_URL }}) (built with commit ${{ steps.source-run-info.outputs.sourceHeadSha }}) is ready! :tada:
[Documentation preview for this PR](${{ steps.deploy-netlify.outputs.NETLIFY_URL }}) (built with commit ${{ steps.source-run-info.outputs.sourceHeadSha }}; [changes](${{ steps.deploy-netlify.outputs.NETLIFY_URL }}/CHANGES.html)) is ready! :tada:
- name: Update deployment status PR check
uses: myrotvorets/set-commit-status-action@1.1.6
uses: myrotvorets/set-commit-status-action@v1.1.7
if: ${{ always() }}
env:
DEPLOY_SUCCESS: Successfully deployed preview.
Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ on:
default: "$BUILD_TAG"
type: string
#
# For use in upstream CIs
# For use in upstream CIs. sage_trac_* are now ignored and will be removed later.
#
upstream_artifact:
required: false
Expand Down Expand Up @@ -163,21 +163,6 @@ jobs:
sudo apt-get --fix-broken --yes remove $(dpkg-query -f '${Package}\n' -W | grep -E '^(ghc-|google-cloud-sdk|google-chrome|firefox|mysql-server|dotnet-sdk|hhvm|mono)') || echo "(error ignored)"
df -h
if: inputs.free_disk_space
- name: Check out git-trac-command
uses: actions/checkout@v3
with:
repository: sagemath/git-trac-command
path: git-trac-command
if: inputs.sage_trac_git != ''
- name: Check out SageMath from trac.sagemath.org
shell: bash {0}
# Random sleep and retry to limit the load on trac.sagemath.org
run: |
git config --global user.email "[email protected]"
git config --global user.name "ci-sage workflow"
if [ ! -d .git ]; then git init; fi; git remote add trac ${{ inputs.sage_trac_git }} && x=1 && while [ $x -le 5 ]; do x=$(( $x + 1 )); sleep $(( $RANDOM % 60 + 1 )); if git-trac-command/git-trac fetch ${{ inputs.sage_trac_ticket }}; then git merge FETCH_HEAD || echo "(ignored)"; exit 0; fi; sleep 40; done; exit 1
if: inputs.sage_trac_git != ''

- name: Download upstream artifact
uses: actions/download-artifact@v3
with:
Expand Down
27 changes: 0 additions & 27 deletions .zenodo.json.in

This file was deleted.

4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ title: SageMath
abstract: SageMath is a free open-source mathematics software system.
authors:
- name: "The SageMath Developers"
version: 9.5
version: 10.1.beta4
doi: 10.5281/zenodo.593563
date-released: 2022-01-18
date-released: 2023-06-21
repository-code: "https://github.com/sagemath/sage"
url: "https://www.sagemath.org/"
11 changes: 11 additions & 0 deletions CITATION.cff.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
title: SageMath
abstract: SageMath is a free open-source mathematics software system.
authors:
- name: "The SageMath Developers"
version: ${SAGE_VERSION}
doi: 10.5281/zenodo.593563
date-released: ${SAGE_RELEASE_DATE}
repository-code: "https://github.com/sagemath/sage"
url: "https://www.sagemath.org/"
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SageMath version 10.1.beta2, Release Date: 2023-06-03
SageMath version 10.1.beta4, Release Date: 2023-06-21
2 changes: 1 addition & 1 deletion build/bin/sage-spkg-info
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PKG_SCRIPTS="$SAGE_ROOT/build/pkgs/$PKG_BASE"
for ext in rst txt; do
SPKG_FILE="$PKG_SCRIPTS/SPKG.$ext"
if [ -f "$SPKG_FILE" ]; then
cat "$SPKG_FILE"
sed "1,3s/^ *Sage: Open Source Mathematics Software:/$PKG_BASE:/" "$SPKG_FILE"
break
fi
done
Expand Down
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=05ff783186ba44f6afec3fad5fecea42acb32db6
md5=ecd17bd2d001b1c17586fa7877550bf9
cksum=1852648534
sha1=b3604052037bc57fb64fcbe347b289dcd959366c
md5=603842fccbd68e1125d32fed8d81ca86
cksum=2053680048
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17aa7f7ea5b8522f028ef5a87613f1979978a748
4fa9c1c33b69fc6c3b948e9df3f7688b61b70589
2 changes: 1 addition & 1 deletion build/pkgs/ecl/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$(MP_LIBRARY) readline gc libffi info
$(MP_LIBRARY) readline gc libffi

----------
All lines of this file are ignored except the first.
1 change: 1 addition & 0 deletions build/pkgs/ecl/dependencies_order_only
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
info
6 changes: 3 additions & 3 deletions build/pkgs/igraph/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=igraph-VERSION.tar.gz
sha1=20587332f0f36d6d7eb3cca248e2dab76e1e58ad
md5=af41eb9c614946c4a92a51834e9cab4a
cksum=4011381306
sha1=fc3c6627f889b13581b2b468e1b16aceff453cfc
md5=10a3f325425970c75a7ba8359376e208
cksum=3103730646
upstream_url=https://github.com/igraph/igraph/releases/download/VERSION/igraph-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/igraph/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.2
0.10.4
1 change: 1 addition & 0 deletions build/pkgs/info/spkg-configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ SAGE_SPKG_CONFIGURE([info], [
AS_IF([makeinfo -c foo 2>&1 | grep -q invalid], [
dnl makeinfo found, but too old, and does not support all options that ecl likes to use
sage_spkg_install_info=yes])
rm -f stdin.info
])
])
])
Loading

0 comments on commit 2eb00e8

Please sign in to comment.