Skip to content

Commit 4013dfe

Browse files
authored
Merge branch 'develop' into sage_knots_mod
2 parents acf9c5a + 2e5cb46 commit 4013dfe

File tree

208 files changed

+12799
-13782
lines changed

Some content is hidden

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

208 files changed

+12799
-13782
lines changed

.ci/create-changes-html.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ fi
88
BASE_DOC_COMMIT="$1"
99
DOC_REPOSITORY="$2"
1010

11-
# Wipe out chronic diffs between old doc and new doc
12-
(cd $DOC_REPOSITORY && find . -name "*.html" | xargs sed -i -e '\;<script type="application/vnd\.jupyter\.widget-state+json">;,\;</script>; d')
1311
# Create CHANGES.html
1412
echo '<html>' > CHANGES.html
1513
echo '<head>' >> CHANGES.html
@@ -19,7 +17,9 @@ echo '<script>hljs.highlightAll();</script>' >> CHANGES.html
1917
cat >> CHANGES.html << EOF
2018
<script>
2119
document.addEventListener('DOMContentLoaded', () => {
22-
const baseDocURL = 'https://sagemath.netlify.app'
20+
// This URL is hardcoded in the file .github/workflows/doc-publish.yml.
21+
// See NETLIFY_ALIAS of the "Deploy to Netlify" step.
22+
const baseDocURL = 'https://doc-develop--sagemath.netlify.app'
2323
const diffSite = 'https://pianomister.github.io/diffsite'
2424
const diffParagraphs = document.querySelectorAll('p.diff');
2525
diffParagraphs.forEach(paragraph => {

.github/workflows/ci-conda-known-test-failures.json

+9
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@
5353
"sage.rings.function_field.drinfeld_modules.morphism": {
5454
"failed": "unreported random failure seen in https://github.com/sagemath/sage/actions/runs/6840502530/job/18599835766#step:11:10107"
5555
},
56+
"sage.rings.number_field.galois_group": {
57+
"failed": "unreported failure on macOS (sort order) in GaloisGroup_v2.artin_symbol, https://github.com/sagemath/sage/actions/runs/9525536510/job/26259809272?pr=37998"
58+
},
59+
"sage.rings.number_field.number_field": {
60+
"failed": "unreported failure on macOS (sort order) in NumberField_absolute.[optimized_]subfields, https://github.com/sagemath/sage/actions/runs/9525536510/job/26259809272?pr=37998"
61+
},
5662
"sage.rings.polynomial.multi_polynomial_ideal": {
5763
"failed": true
5864
},
@@ -65,6 +71,9 @@
6571
"sage.rings.polynomial.skew_polynomial_finite_field": {
6672
"failed": true
6773
},
74+
"sage.rings.qqbar": {
75+
"failed": "unreported failure on macOS seen in https://github.com/sagemath/sage/actions/runs/9525536510/job/26259809272?pr=37998"
76+
},
6877
"sage.schemes.elliptic_curves.descent_two_isogeny": {
6978
"failed": "random segfault (macOS) https://github.com/sagemath/sage/issues/36949"
7079
},

.github/workflows/ci-conda.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ concurrency:
1818
jobs:
1919
test:
2020
name: Conda
21-
runs-on: ${{ matrix.os }}-latest
21+
runs-on: ${{ matrix.os }}
2222

2323
strategy:
24+
fail-fast: false
2425
matrix:
2526
# On pushes to tags or branches, test the whole matrix.
2627
os: >-
2728
${{ github.event_name == 'pull_request'
28-
&& fromJson('["ubuntu"]')
29-
|| fromJson('["ubuntu", "macos"]') }}
29+
&& fromJson('["ubuntu-latest"]')
30+
|| fromJson('["ubuntu-latest", "macos-latest", "macos-13"]') }}
3031
python: >-
3132
${{ github.event_name == 'pull_request'
3233
&& fromJson('["3.9"]')
@@ -35,12 +36,12 @@ jobs:
3536
# environment: [environment, environment-optional]
3637
conda-env: [environment]
3738
# On pull requests, only test two jobs:
38-
# Ubuntu with Python 3.9, macOS with Python 3.11.
39+
# Ubuntu with Python 3.9, macOS (arm64) with Python 3.11.
3940
# Build & Test currently uses Python 3.10 (on ubuntu-jammy).
4041
# Together, they cover the supported minor Python versions.
4142
include: >-
4243
${{ github.event_name == 'pull_request'
43-
&& fromJson('[{"os": "macos", "python": "3.11", "conda-env": "environment"}]')
44+
&& fromJson('[{"os": "macos-latest", "python": "3.11", "conda-env": "environment"}]')
4445
|| fromJson('[]') }}
4546
4647
steps:
@@ -69,7 +70,7 @@ jobs:
6970
channels: conda-forge
7071
channel-priority: true
7172
activate-environment: sage
72-
environment-file: src/${{ matrix.conda-env }}-${{ matrix.python }}-${{ startsWith(matrix.os, 'macos') && 'macos' || 'linux' }}.yml
73+
environment-file: src/${{ matrix.conda-env }}-${{ matrix.python }}-${{ startsWith(matrix.os, 'macos') && (startsWith(runner.arch, 'ARM') && 'macos' || 'macos-x86_64') || 'linux' }}.yml
7374

7475
- name: Print Conda environment
7576
shell: bash -l {0}
@@ -89,8 +90,8 @@ jobs:
8990
# Use --no-deps and pip check below to verify that all necessary dependencies are installed via conda.
9091
pip install --no-build-isolation --no-deps --config-settings editable_mode=compat -v -v -e ./src
9192
env:
92-
SAGE_NUM_THREADS: 2
93-
93+
SAGE_NUM_THREADS: 5
94+
9495
- name: Verify dependencies
9596
if: success() || failure()
9697
shell: bash -l {0}

.github/workflows/conda-lock-update.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
platforms = {
1212
"linux-64": "linux",
1313
"linux-aarch64": "linux-aarch64",
14-
"osx-64": "macos",
15-
"osx-arm64": "macos-arm64"
14+
"osx-64": "macos-x86_64",
15+
"osx-arm64": "macos"
1616
#"win-64": "win",
1717
}
1818
pythons = ["3.9", "3.10", "3.11"]

.github/workflows/doc-build-pdf.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ env:
3030
EXTRA_CONFIGURE_ARGS: --enable-fat-binary
3131

3232
jobs:
33-
build-docs-pdf:
33+
build-doc-pdf:
3434
runs-on: ubuntu-latest
3535
services:
3636
# https://docs.docker.com/build/ci/github-actions/local-registry/
@@ -110,7 +110,9 @@ jobs:
110110
--workdir $(pwd) \
111111
${{ env.BUILD_IMAGE }} /bin/sh
112112
113-
# Docs
113+
#
114+
# On PRs and pushes to branches
115+
#
114116

115117
- name: Update system packages
116118
id: packages
@@ -122,29 +124,27 @@ jobs:
122124
eval $(sage-print-system-package-command auto --spkg --yes --no-install-recommends install git texlive texlive_luatex free_fonts xindy)
123125
shell: sh .ci/docker-exec-script.sh BUILD /sage {0}
124126

125-
- name: Build docs (PDF)
127+
- name: Build doc (PDF)
126128
id: docbuild
127129
if: (success() || failure()) && steps.packages.outcome == 'success'
128130
run: |
129131
export MAKE="make -j5 --output-sync=recurse" SAGE_NUM_THREADS=5
130132
make doc-clean doc-uninstall; make sagemath_doc_html-build-deps sagemath_doc_pdf-no-deps
131133
shell: sh .ci/docker-exec-script.sh BUILD /sage {0}
132134

133-
- name: Copy docs
135+
- name: Copy doc
134136
id: copy
135137
if: (success() || failure()) && steps.docbuild.outcome == 'success'
136138
run: |
137-
# For some reason the deploy step below cannot find /sage/...
138-
# So copy everything from there to local folder
139-
mkdir -p ./docs
140-
cp -r -L /sage/local/share/doc/sage/pdf ./docs
139+
mkdir -p ./doc
140+
# We copy everything to a local folder
141+
docker cp BUILD:/sage/local/share/doc/sage/pdf doc
141142
# Zip everything for increased performance
142-
zip -r docs-pdf.zip docs
143-
shell: sh .ci/docker-exec-script.sh BUILD /sage {0}
143+
zip -r doc-pdf.zip doc
144144
145-
- name: Upload docs
145+
- name: Upload doc
146146
if: (success() || failure()) && steps.copy.outcome == 'success'
147-
uses: actions/upload-artifact@v3
147+
uses: actions/upload-artifact@v4
148148
with:
149-
name: docs-pdf
150-
path: docs-pdf.zip
149+
name: doc-pdf
150+
path: doc-pdf.zip

.github/workflows/doc-build.yml

+85-59
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@ on:
44
pull_request:
55
merge_group:
66
push:
7+
tags:
8+
# Match all release tags including beta, rc
9+
- '[0-9]+.[0-9]+'
10+
- '[0-9]+.[0-9]+.[0-9]+'
11+
- '[0-9]+.[0-9]+.beta[0-9]+'
12+
- '[0-9]+.[0-9]+.[0-9]+.beta[0-9]+'
13+
- '[0-9]+.[0-9]+.rc[0-9]+'
14+
- '[0-9]+.[0-9]+.[0-9]+.rc[0-9]+'
715
branches:
8-
- master
916
- develop
1017
workflow_dispatch:
1118
# Allow to run manually
@@ -34,7 +41,7 @@ env:
3441
EXTRA_CONFIGURE_ARGS: --enable-fat-binary
3542

3643
jobs:
37-
build-docs:
44+
build-doc:
3845
runs-on: ubuntu-latest
3946
services:
4047
# https://docs.docker.com/build/ci/github-actions/local-registry/
@@ -114,38 +121,50 @@ jobs:
114121
--workdir $(pwd) \
115122
${{ env.BUILD_IMAGE }} /bin/sh
116123
117-
# Docs
124+
#
125+
# On PRs and pushes to develop
126+
#
118127

119-
- name: Store old docs
128+
- name: Store old doc
120129
id: worktree
121-
if: (success() || failure()) && steps.container.outcome == 'success'
130+
if: (success() || failure()) && steps.container.outcome == 'success' && !startsWith(github.ref, 'refs/tags/')
122131
run: |
123132
git config --global --add safe.directory $(pwd)
124133
git config --global user.email "[email protected]"
125134
git config --global user.name "Build documentation workflow"
126-
# mathjax path in old doc (regex)
127-
mathjax_path_from="[-./A-Za-z_]*/tex-chtml[.]js?v=[0-9a-f]*"
128-
# mathjax path in new doc
129-
mathjax_path_to=$(docker exec -e SAGE_USE_CDNS=yes BUILD /sage/sage -python -c "from sage_docbuild.conf import mathjax_path; print(mathjax_path)")
130-
new_version=$(docker exec BUILD cat src/VERSION.txt)
131-
mkdir -p docs/
132-
docker cp BUILD:/sage/local/share/doc/sage/html docs/
133-
# Wipe out chronic diffs of old doc against new doc
134-
(cd docs && \
135-
find . -name "*.html" | xargs sed -i -e '/class="sidebar-brand-text"/ s/Sage [0-9a-z.]* /Sage '"$new_version"' /' \
136-
-e '/<link rel="stylesheet"/ s/?v=[0-9a-f]*"/"/' \
137-
-e 's;'"$mathjax_path_from"';'"$mathjax_path_to"';' \
138-
-e '\;<script type="application/vnd\.jupyter\.widget-state+json">;,\;</script>; d')
139-
# Create git repo from old doc
140-
(cd docs && \
141-
git init && \
142-
(echo "*.svg binary"; echo "*.pdf binary") >> .gitattributes && \
143-
(echo ".buildinfo"; echo '*.inv'; echo '.git*'; echo '*.svg'; echo '*.pdf'; echo '*.png'; echo 'searchindex.js') > .gitignore; \
144-
git add -A && git commit --quiet -m "old")
145-
146-
- name: Build docs
135+
# Check if we are on PR
136+
PR_NUMBER=""
137+
if [[ -n "$GITHUB_REF" ]]; then
138+
if [[ "$GITHUB_REF" =~ refs/pull/([0-9]+)/merge ]]; then
139+
PR_NUMBER="${BASH_REMATCH[1]}"
140+
fi
141+
fi
142+
# If so, then prepare to create CHANGES.html
143+
if [[ -n "$PR_NUMBER" ]]; then
144+
# mathjax path in old doc (regex)
145+
mathjax_path_from="[-./A-Za-z_]*/tex-chtml[.]js?v=[0-9a-f]*"
146+
# mathjax path in new doc
147+
mathjax_path_to=$(docker exec -e SAGE_USE_CDNS=yes BUILD /sage/sage -python -c "from sage_docbuild.conf import mathjax_path; print(mathjax_path)")
148+
new_version=$(docker exec BUILD cat src/VERSION.txt)
149+
mkdir -p doc/
150+
docker cp BUILD:/sage/local/share/doc/sage/html doc/
151+
# Wipe out chronic diffs between old doc and new doc
152+
(cd doc && \
153+
find . -name "*.html" | xargs sed -i -e '/class="sidebar-brand-text"/ s/Sage [0-9a-z.]* /Sage '"$new_version"' /' \
154+
-e '/<link rel="stylesheet"/ s/?v=[0-9a-f]*"/"/' \
155+
-e 's;'"$mathjax_path_from"';'"$mathjax_path_to"';' \
156+
-e '\;<script type="application/vnd\.jupyter\.widget-state+json">;,\;</script>; d')
157+
# Create git repo from old doc
158+
(cd doc && \
159+
git init && \
160+
(echo "*.svg binary"; echo "*.pdf binary") >> .gitattributes && \
161+
(echo ".buildinfo"; echo '*.inv'; echo '.git*'; echo '*.svg'; echo '*.pdf'; echo '*.png'; echo 'searchindex.js') > .gitignore; \
162+
git add -A && git commit --quiet -m 'old')
163+
fi
164+
165+
- name: Build doc
147166
id: docbuild
148-
if: (success() || failure()) && steps.worktree.outcome == 'success'
167+
if: (success() || failure()) && steps.worktree.outcome == 'success' && !startsWith(github.ref, 'refs/tags/')
149168
# Always non-incremental because of the concern that
150169
# incremental docbuild may introduce broken links (inter-file references) though build succeeds
151170
run: |
@@ -157,50 +176,57 @@ jobs:
157176
./config.status && make sagemath_doc_html-no-deps
158177
shell: sh .ci/docker-exec-script.sh BUILD /sage {0}
159178

160-
- name: Copy docs
179+
- name: Copy doc
161180
id: copy
162181
if: (success() || failure()) && steps.docbuild.outcome == 'success'
163182
run: |
164183
set -ex
165184
# We copy everything to a local folder
166-
docker cp BUILD:/sage/local/share/doc/sage/html docs
167-
docker cp BUILD:/sage/local/share/doc/sage/index.html docs
168-
(cd docs && git commit -a -m 'new')
169-
# Wipe out chronic diffs of new doc against old doc
170-
(cd docs && \
171-
find . -name "*.html" | xargs sed -i -e '/This is documentation for/ s/ built with GitHub PR .*. Doc/. Doc/' \
172-
-e '/<link rel="stylesheet"/ s/?v=[0-9a-f]*"/"/')
173-
.ci/create-changes-html.sh $(cd docs && git rev-parse HEAD^) docs
174-
# Restore the new doc from changes by "wipe out"
175-
(cd docs && git checkout -f)
176-
(cd docs && rm -rf .git)
177-
mv CHANGES.html docs
178-
# We also need to replace the symlinks because netlify is not following them
179-
# CHECK IF STILL NEEDED
180-
#cp -r -L $DOC_DIR ./docs
185+
docker cp --follow-link BUILD:/sage/local/share/doc/sage/html doc
186+
docker cp --follow-link BUILD:/sage/local/share/doc/sage/index.html doc
187+
# Check if we are on PR
188+
PR_NUMBER=""
189+
if [[ -n "$GITHUB_REF" ]]; then
190+
if [[ "$GITHUB_REF" =~ refs/pull/([0-9]+)/merge ]]; then
191+
PR_NUMBER="${BASH_REMATCH[1]}"
192+
fi
193+
fi
194+
# If so, then create CHANGES.html
195+
if [[ -n "$PR_NUMBER" ]]; then
196+
(cd doc && git commit -a -m 'new')
197+
# Wipe out chronic diffs of new doc against old doc before creating CHANGES.html
198+
(cd doc && \
199+
find . -name "*.html" | xargs sed -i -e '/This is documentation of/ s/ built with GitHub PR .* for development/ for development/' \
200+
-e '/<link rel="stylesheet"/ s/?v=[0-9a-f]*"/"/' \
201+
-e '\;<script type="application/vnd\.jupyter\.widget-state+json">;,\;</script>; d' \
202+
&& git commit -a -m 'wipe-out')
203+
# Since HEAD is at commit 'wipe-out', HEAD~1 is commit 'new' (new doc), HEAD~2 is commit 'old' (old doc)
204+
.ci/create-changes-html.sh $(cd doc && git rev-parse HEAD~2) doc
205+
# Restore the new doc with changes made in create-changes-html.sh but dropping changes by "wipe out"
206+
(cd doc && git stash -q && git checkout -q -f HEAD~1 && git stash pop -q)
207+
# Sometimes rm -rf .git errors out because of some diehard hidden files
208+
# So we simply move it out of the doc directory
209+
(cd doc && mv .git ../git && mv .gitattributes ../gitattributes)
210+
mv CHANGES.html doc
211+
fi
181212
# Zip everything for increased performance
182-
zip -r docs.zip docs
213+
zip -r doc.zip doc
183214
184-
- name: Upload docs
215+
- name: Upload doc
185216
id: upload
186217
if: (success() || failure()) && steps.copy.outcome == 'success'
187-
uses: actions/upload-artifact@v3
218+
uses: actions/upload-artifact@v4
188219
with:
189-
name: docs
190-
path: docs.zip
220+
name: doc
221+
path: doc.zip
191222

192-
- name: Save space
193-
id: savespace
194-
if: (success() || failure()) && steps.upload.outcome == 'success' && github.repository == 'sagemath/sage' && github.ref == 'refs/heads/develop'
195-
run: |
196-
set -ex
197-
# Save space on runner device before we start to build livedoc
198-
rm -rf docs/
199-
rm -f docs.zip
223+
#
224+
# On release tags: live doc and wheels
225+
#
200226

201227
- name: Build live doc
202228
id: buildlivedoc
203-
if: (success() || failure()) && steps.savespace.outcome == 'success'
229+
if: (success() || failure()) && startsWith(github.ref, 'refs/tags/')
204230
run: |
205231
export MAKE="make -j5 --output-sync=recurse" SAGE_NUM_THREADS=5
206232
export PATH="build/bin:$PATH"
@@ -222,12 +248,12 @@ jobs:
222248
# We copy everything to a local folder
223249
docker cp --follow-link BUILD:/sage/local/share/doc/sage/html livedoc
224250
docker cp --follow-link BUILD:/sage/local/share/doc/sage/pdf livedoc
225-
docker cp BUILD:/sage/local/share/doc/sage/index.html livedoc
251+
docker cp --follow-link BUILD:/sage/local/share/doc/sage/index.html livedoc
226252
zip -r livedoc.zip livedoc
227253
228254
- name: Upload live doc
229255
if: (success() || failure()) && steps.copylivedoc.outcome == 'success'
230-
uses: actions/upload-artifact@v3
256+
uses: actions/upload-artifact@v4
231257
with:
232258
name: livedoc
233259
path: livedoc.zip

0 commit comments

Comments
 (0)