Skip to content

Commit 3b3b72b

Browse files
author
Matthias Koeppe
committed
Merge remote-tracking branch 'upstream/develop' into sagemath_categories_distribution_directives_2024
2 parents 82dc512 + e5f42fa commit 3b3b72b

File tree

1,133 files changed

+12204
-8775
lines changed

Some content is hidden

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

1,133 files changed

+12204
-8775
lines changed

.ci/retrofit-worktree.sh

+3-7
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,14 @@ git tag -f new
3232
# But $WORKTREE_DIRECTORY is not a git repository.
3333
# We make $WORKTREE_DIRECTORY a worktree whose index is at tag "new".
3434
# We then commit the current sources and set the tag "old". (This keeps all mtimes unchanged.)
35-
# Then we update worktree and index with "git reset --hard new".
35+
# Then we update worktree and index with "git checkout new".
3636
# (This keeps mtimes of unchanged files unchanged and mtimes of changed files newer than unchanged files.)
37-
# Finally we reset the index to "old". (This keeps all mtimes unchanged.)
38-
# The changed files now show up as uncommitted changes.
39-
# The final "git add -N" makes sure that files that were added in "new" do not show
40-
# as untracked files, which would be removed by "git clean -fx".
4137
if [ -L $WORKTREE_NAME ]; then
4238
rm -f $WORKTREE_NAME
43-
git worktree prune --verbose
4439
fi
40+
git worktree prune --verbose
4541
git worktree add --detach $WORKTREE_NAME
4642
rm -rf $WORKTREE_DIRECTORY/.git && mv $WORKTREE_NAME/.git $WORKTREE_DIRECTORY/
4743
rm -rf $WORKTREE_NAME && ln -s $WORKTREE_DIRECTORY $WORKTREE_NAME
4844
if [ ! -f $WORKTREE_NAME/.gitignore ]; then cp .gitignore $WORKTREE_NAME/; fi
49-
(cd $WORKTREE_NAME && git add -A && git commit --quiet --allow-empty -m "old" -a && git tag -f old && git reset --hard new && git reset --quiet old && git add -N . && git status)
45+
(cd $WORKTREE_NAME && git add -A && git commit --quiet --allow-empty -m "old" -a && git tag -f old && git checkout new && git status)

.ci/write-dockerfile.sh

+9-4
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ case $SYSTEM in
8888
cat <<EOF
8989
RUN if command -v unminimize > /dev/null; then \
9090
(yes | unminimize) || echo "(ignored)"; \
91-
rm -f "$(command -v unminimize)"; \
91+
rm -f "\$(command -v unminimize)"; \
9292
fi
9393
EOF
9494
if [ -n "$DIST_UPGRADE" ]; then
@@ -272,13 +272,14 @@ $ADD src/Pipfile.m4 src/pyproject.toml src/requirements.txt.m4 src/setup.cfg.m4
272272
$ADD m4 /new/m4
273273
$ADD pkgs /new/pkgs
274274
$ADD build /new/build
275-
$ADD .ci /new/.ci
276275
$ADD .upstream.d /new/.upstream.d
276+
ADD .ci /.ci
277277
RUN if [ -d /sage ]; then \
278278
echo "### Incremental build from \$(cat /sage/VERSION.txt)" && \
279279
printf '/src\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /sage/.gitignore && \
280280
printf '/src\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /new/.gitignore && \
281-
if ! (cd /new && ./.ci/retrofit-worktree.sh worktree-image /sage); then \
281+
if ! (cd /new && /.ci/retrofit-worktree.sh worktree-image /sage); then \
282+
echo "retrofit-worktree.sh failed, falling back to replacing /sage"; \
282283
for a in local logs; do \
283284
if [ -d /sage/\$a ]; then mv /sage/\$a /new/; fi; \
284285
done; \
@@ -337,8 +338,12 @@ ENV SAGE_CHECK=warn
337338
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst"
338339
$ADD .gitignore /new/.gitignore
339340
$ADD src /new/src
341+
ADD .ci /.ci
340342
RUN cd /new && rm -rf .git && \
341-
if ! /sage/.ci/retrofit-worktree.sh worktree-pre /sage; then \
343+
if /.ci/retrofit-worktree.sh worktree-pre /sage; then \
344+
cd /sage && touch configure build/make/Makefile; \
345+
else \
346+
echo "retrofit-worktree.sh failed, falling back to replacing /sage/src"; \
342347
rm -rf /sage/src; \
343348
mv src /sage/src; \
344349
cd /sage && ./bootstrap && ./config.status; \

.github/workflows/build.yml

+143-11
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,20 @@ jobs:
175175
./sage -python -m pytest -c tox.ini -qq --doctest --collect-only || true
176176
shell: sh .ci/docker-exec-script.sh BUILD /sage {0}
177177

178+
- name: Get changed files
179+
id: changed-files
180+
uses: tj-actions/changed-files@v44
181+
with:
182+
# File extensions per sage.doctest.control.skipfile
183+
files: src/**/*.{py,pyx,pxd,pxi,sage,spyx,rst,tex}
184+
files_ignore: src/{setup,conftest*}.py
185+
178186
- name: Test changed files (sage -t --new)
187+
if: steps.changed-files.outputs.all_changed_files
179188
run: |
180189
export MAKE="make -j2 --output-sync=recurse" SAGE_NUM_THREADS=4
181-
# We run tests with "sage -t --new"; this only tests the uncommitted changes.
182-
./sage -t --new -p4
190+
# https://github.com/tj-actions/changed-files?tab=readme-ov-file#outputs-
191+
./sage -t --long --format github -p4 ${{ steps.changed-files.outputs.all_changed_files }}
183192
shell: sh .ci/docker-exec-script.sh BUILD /sage {0}
184193

185194
test-mod:
@@ -283,6 +292,14 @@ jobs:
283292
image: registry:2
284293
ports:
285294
- 5000:5000
295+
strategy:
296+
fail-fast: false
297+
matrix:
298+
tests:
299+
- "src/sage/[a-f]*"
300+
- "src/sage/[g-o]*"
301+
- "src/sage/[p-z]*"
302+
- "src/doc src/sage_docbuild src/sage_setup"
286303
steps:
287304
- name: Maximize build disk space
288305
uses: easimon/maximize-build-space@v10
@@ -356,23 +373,138 @@ jobs:
356373
357374
# Testing
358375

359-
- name: Test all files (sage -t --all --long)
376+
- name: Test all files (sage -t --long ${{ matrix.tests }})
360377
run: |
378+
mkdir .coverage
379+
rm -rf /sage/.coverage
380+
ln -s $(pwd)/.coverage /sage/
381+
cd /sage
361382
./sage -python -m pip install coverage
362-
./sage -python -m coverage run --rcfile=src/tox.ini src/bin/sage-runtests --all --long -p4 --format github --random-seed=286735480429121101562228604801325644303
363-
shell: sh .ci/docker-exec-script.sh BUILD /sage {0}
383+
./sage -python -m coverage run --rcfile=src/tox.ini src/bin/sage-runtests --force-lib --long -p4 --format github --random-seed=286735480429121101562228604801325644303 ${{ matrix.tests }}
384+
shell: sh .ci/docker-exec-script.sh BUILD . {0}
364385

365-
- name: Copy coverage results
386+
- name: Combine coverage results
366387
if: (success() || failure()) && steps.container.outcome == 'success'
367388
run: |
368389
./sage -python -m coverage combine --rcfile=src/tox.ini
369-
./sage -python -m coverage xml --rcfile=src/tox.ini
370-
mkdir -p coverage-report
371-
mv coverage.xml coverage-report/
372390
shell: sh .ci/docker-exec-script.sh BUILD /sage {0}
373391

374-
- name: Upload coverage to codecov
392+
- name: Prepare upload
393+
id: copy-coverage
375394
if: (success() || failure()) && steps.container.outcome == 'success'
395+
run: |
396+
echo tests_id=$(echo "${{ matrix.tests }}" | sed -E 's, +,--,g;s,/,_,g;s/[^-_A-Za-z]//g;') >> "$GITHUB_OUTPUT"
397+
398+
- name: Upload coverage results
399+
if: (success() || failure()) && steps.container.outcome == 'success'
400+
uses: actions/upload-artifact@v4
401+
with:
402+
name: coverage-${{ steps.copy-coverage.outputs.tests_id }}
403+
path: .coverage
404+
405+
coverage-report:
406+
runs-on: ubuntu-latest
407+
needs: [test-long]
408+
if: (success() || failure())
409+
services:
410+
# https://docs.docker.com/build/ci/github-actions/local-registry/
411+
registry:
412+
image: registry:2
413+
ports:
414+
- 5000:5000
415+
steps:
416+
- name: Maximize build disk space
417+
uses: easimon/maximize-build-space@v10
418+
with:
419+
# need space in /var for Docker images
420+
root-reserve-mb: 30000
421+
remove-dotnet: true
422+
remove-android: true
423+
remove-haskell: true
424+
remove-codeql: true
425+
remove-docker-images: true
426+
- name: Checkout
427+
id: checkout
428+
uses: actions/checkout@v4
429+
- name: Install test prerequisites
430+
# From docker.yml
431+
run: |
432+
sudo DEBIAN_FRONTEND=noninteractive apt-get update
433+
sudo DEBIAN_FRONTEND=noninteractive apt-get install tox
434+
sudo apt-get clean
435+
df -h
436+
- name: Merge CI fixes from sagemath/sage
437+
# From docker.yml
438+
# This step needs to happen after the commit sha is put in DOCKER_TAG
439+
# so that multi-stage builds can work correctly.
440+
run: |
441+
.ci/merge-fixes.sh
442+
env:
443+
GH_TOKEN: ${{ github.token }}
444+
445+
# Building
446+
447+
- name: Generate Dockerfile
448+
# From docker.yml
449+
run: |
450+
tox -e ${{ env.TOX_ENV }}
451+
cp .tox/${{ env.TOX_ENV }}/Dockerfile .
452+
env:
453+
# Only generate the Dockerfile, do not run 'docker build' here
454+
DOCKER_TARGETS: ""
455+
456+
- name: Set up Docker Buildx
457+
uses: docker/setup-buildx-action@v3
458+
with:
459+
driver-opts: network=host
460+
461+
- name: Build Docker image
462+
id: image
463+
uses: docker/build-push-action@v5
464+
with:
465+
push: true
466+
load: false
467+
context: .
468+
tags: ${{ env.BUILD_IMAGE }}
469+
target: with-targets
470+
cache-from: type=gha
471+
cache-to: type=gha,mode=max
472+
build-args: |
473+
NUMPROC=6
474+
USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse
475+
TARGETS_PRE=build/make/Makefile
476+
TARGETS=ci-build-with-fallback
477+
478+
- name: Start container
479+
id: container
480+
run: |
481+
docker run --name BUILD -dit \
482+
--mount type=bind,src=$(pwd),dst=$(pwd) \
483+
--workdir $(pwd) \
484+
${{ env.BUILD_IMAGE }} /bin/sh
485+
486+
# Combining
487+
488+
- name: Download coverage artifacts
489+
uses: actions/download-artifact@v4
490+
with:
491+
path: .coverage
492+
pattern: coverage-*
493+
494+
- name: Coverage report
495+
# Using --omit to avoid "CoverageWarning: Couldn't parse '/tmp/tmp06qizzie/tmp_ldpu46ob.py': No source for code"
496+
run: |
497+
rm -rf /sage/.coverage
498+
ln -s $(pwd)/.coverage /sage/
499+
cd /sage
500+
./sage -python -m pip install coverage
501+
./sage -python -m coverage combine --rcfile=src/tox.ini .coverage/coverage-*/.coverage
502+
./sage -python -m coverage xml --rcfile=src/tox.ini --omit="/tmp/*"
503+
mkdir -p .coverage/coverage-report
504+
mv coverage.xml .coverage/coverage-report/
505+
shell: sh .ci/docker-exec-script.sh BUILD . {0}
506+
507+
- name: Upload coverage to codecov
376508
uses: codecov/codecov-action@v4
377509
with:
378-
directory: ./coverage-report
510+
directory: .coverage/coverage-report

.github/workflows/ci-macos.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
fail-fast: false
110110
max-parallel: 4
111111
matrix:
112-
os: [ macos-11, macos-12, macos-14 ]
112+
os: [ macos-12, macos-13, macos-14 ]
113113
tox_system_factor: [macos-nobootstrap]
114114
tox_packages_factor: [minimal]
115115
xcode_version_factor: [default]

.github/workflows/dist.yml

+14
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,20 @@ jobs:
240240
name: ${{ matrix.os }}-${{ matrix.arch }}-wheels
241241
path: ./wheelhouse/*.whl
242242

243+
upload_wheels:
244+
# This needs to be a separate job because pypa/gh-action-pypi-publish cannot run on macOS
245+
needs: build_wheels
246+
runs-on: ubuntu-latest
247+
env:
248+
CAN_DEPLOY: ${{ secrets.SAGEMATH_PYPI_API_TOKEN != '' }}
249+
steps:
250+
251+
- uses: actions/download-artifact@v4
252+
with:
253+
pattern: "*-*-wheels"
254+
path: wheelhouse
255+
merge-multiple: true
256+
243257
- uses: pypa/gh-action-pypi-publish@release/v1
244258
with:
245259
user: __token__

.github/workflows/doc-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ jobs:
188188
export SAGE_JUPYTER_SERVER=binder:sagemath/sage-binder-env/dev
189189
make doc-clean doc-uninstall
190190
./config.status && make sagemath_doc_html-no-deps sagemath_doc_pdf-no-deps
191-
shell: sh .ci/docker-exec-script.sh BUILD ./worktree-image {0}
191+
shell: sh .ci/docker-exec-script.sh BUILD /sage {0}
192192

193193
- name: Copy live doc
194194
id: copylivedoc

.github/workflows/macos.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,19 @@ on:
1919
type: string
2020
# System configuration
2121
osversion_xcodeversion_toxenv_tuples:
22-
# As of 2024-02, "runs-on: macos-latest" is macos-12.
23-
# and "runs-on: macos-14" selects the new M1 runners.
22+
# As of 2024-05, "runs-on: macos-latest" and "runs-on: macos-14" selects the new M1 runners.
2423
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
2524
description: 'Stringified JSON object'
2625
default: >-
27-
[["11", "xcode_13.2.1", "homebrew-macos-usrlocal-minimal"],
28-
["12", "", "homebrew-macos-usrlocal-minimal"],
26+
[["12", "", "homebrew-macos-usrlocal-minimal"],
2927
["12", "", "homebrew-macos-usrlocal-standard"],
3028
["12", "", "homebrew-macos-usrlocal-python3_xcode-standard"],
3129
["12", "", "homebrew-macos-usrlocal-maximal"],
3230
["13", "xcode_15.0", "homebrew-macos-usrlocal-standard"],
33-
["14", "", "homebrew-macos-opthomebrew-standard"],
34-
["latest", "", "conda-forge-macos-minimal"],
35-
["latest", "", "conda-forge-macos-standard"],
36-
["14", "", "conda-forge-macos-standard"]]
31+
["latest", "", "homebrew-macos-opthomebrew-standard"],
32+
["13", "", "conda-forge-macos-minimal"],
33+
["13", "", "conda-forge-macos-standard"],
34+
["latest", "", "conda-forge-macos-standard"]]
3735
type: string
3836
extra_sage_packages:
3937
description: 'Extra Sage packages to install as system packages'

CITATION.cff

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: SageMath
44
abstract: SageMath is a free open-source mathematics software system.
55
authors:
66
- name: "The SageMath Developers"
7-
version: 10.4.beta7
7+
version: 10.4.beta8
88
doi: 10.5281/zenodo.8042260
9-
date-released: 2024-05-25
9+
date-released: 2024-06-01
1010
repository-code: "https://github.com/sagemath/sage"
1111
url: "https://www.sagemath.org/"

VERSION.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SageMath version 10.4.beta7, Release Date: 2024-05-25
1+
SageMath version 10.4.beta8, Release Date: 2024-06-01

0 commit comments

Comments
 (0)