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

Commit 1787e98

Browse files
author
Matthias Koeppe
committed
Merge tag '9.7.beta5' into t/33530/upgrade_ipython_to_8_x___requires_dropping_python_3_7
SageMath version 9.7.beta5, Release Date: 2022-07-10
2 parents dbb63fa + 625ac58 commit 1787e98

File tree

501 files changed

+10579
-8533
lines changed

Some content is hidden

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

501 files changed

+10579
-8533
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
# Install test tools.
3333
# Installation of python3-venv can be removed as soon as a
3434
# base image with a release including #33822 is available
35+
apt-get update
3536
apt-get install -y git python3-venv
3637
# Reuse built SAGE_LOCAL contained in the Docker image
3738
./bootstrap

.github/workflows/ci-cygwin-minimal.yml

Lines changed: 0 additions & 1044 deletions
This file was deleted.

.github/workflows/ci-cygwin-standard.yml

Lines changed: 73 additions & 978 deletions
Large diffs are not rendered by default.

.github/workflows/ci-macos.yml

Lines changed: 226 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
name: CI macOS
2+
3+
## This GitHub Actions workflow runs SAGE_ROOT/tox.ini with select environments,
4+
## whenever a GitHub pull request is opened or synchronized in a repository
5+
## where GitHub Actions are enabled.
6+
##
7+
## It builds and checks some sage spkgs as defined in TARGETS.
8+
##
9+
## A job succeeds if there is no error.
10+
##
11+
## The build is run with "make V=0", so the build logs of individual packages are suppressed.
12+
##
13+
## At the end, all package build logs that contain an error are printed out.
14+
##
15+
## After all jobs have finished (or are canceled) and a short delay,
16+
## tar files of all logs are made available as "build artifacts".
17+
18+
#on: [push, pull_request]
19+
20+
on:
21+
pull_request:
22+
types: [opened, synchronize]
23+
push:
24+
tags:
25+
- '*'
26+
workflow_dispatch:
27+
# Allow to run manually
28+
29+
env:
30+
TARGETS_PRE: all-sage-local
31+
TARGETS: build doc-html
32+
TARGETS_OPTIONAL: ptest
33+
34+
jobs:
35+
local-macos:
36+
37+
runs-on: ${{ matrix.os }}
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
stage: ["1", "2", "2-optional-0-o", "2-optional-p-z", "2-experimental-0-o", "2-experimental-p-z"]
42+
# python3_xcode is only accepted if enough packages are available from the system
43+
# --> to test "minimal", we would need https://trac.sagemath.org/ticket/30949
44+
tox_env: [homebrew-macos-usrlocal-minimal, homebrew-macos-usrlocal-standard, homebrew-macos-usrlocal-maximal, homebrew-macos-usrlocal-python3_xcode-standard, conda-forge-macos-minimal, conda-forge-macos-standard, conda-forge-macos-maximal]
45+
# As of 2021-12, default xcode
46+
# - on macos-10.15: 12.4
47+
# - on macos-latest (= macos-11): 13.1
48+
# https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.md#xcode
49+
xcode_version_factor: [default]
50+
os: [ macos-10.15, macos-latest ]
51+
env:
52+
TOX_ENV: local-${{ matrix.tox_env }}
53+
LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-tox-local-${{ matrix.tox_env }}-${{ matrix.os }}-xcode_${{ matrix.xcode_version_factor }}
54+
LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-local-${{ matrix.tox_env }}--${{ matrix.os }}-xcode_${{ matrix.xcode_version_factor }}
55+
steps:
56+
- uses: actions/checkout@v2
57+
- name: Select Xcode version
58+
run: |
59+
if [ ${{ matrix.xcode_version_factor }} != default ]; then sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode_version_factor }}.app; fi
60+
- name: Install test prerequisites
61+
run: |
62+
brew install tox
63+
- uses: actions/download-artifact@v2
64+
with:
65+
path: sage-local-artifact
66+
name: ${{ env.LOCAL_ARTIFACT_NAME }}
67+
if: contains(matrix.stage, '2')
68+
- name: Extract sage-local artifact
69+
# This is macOS tar -- cannot use --listed-incremental
70+
run: |
71+
export SAGE_LOCAL=$(pwd)/.tox/$TOX_ENV/local
72+
.github/workflows/extract-sage-local.sh sage-local-artifact/sage-local-*.tar
73+
if: contains(matrix.stage, '2')
74+
- name: Build and test with tox
75+
# We use a high parallelization on purpose in order to catch possible parallelization bugs in the build scripts.
76+
# For doctesting, we use a lower parallelization to avoid timeouts.
77+
run: |
78+
case "${{ matrix.stage }}" in
79+
1) export TARGETS_PRE="all-sage-local" TARGETS="all-sage-local" TARGETS_OPTIONAL=""
80+
;;
81+
2) export TARGETS_PRE="all-sage-local" TARGETS="build doc-html" TARGETS_OPTIONAL="ptest"
82+
;;
83+
2-optional*) export TARGETS_PRE="build/make/Makefile" TARGETS="build/make/Makefile"
84+
targets_pattern="${{ matrix.stage }}"
85+
targets_pattern="${targets_pattern#2-optional-}"
86+
export TARGETS_OPTIONAL=$( echo $(export PATH=build/bin:$PATH && (for a in spkg-install.in spkg-install requirements.txt; do sage-package list :optional: --has-file $a --no-file huge --no-file has_nonfree_dependencies; done) | grep -v ^_ | grep -v sagemath_doc | grep "^[$targets_pattern]" ) )
87+
;;
88+
2-experimental*) export TARGETS_PRE="build/make/Makefile" TARGETS="build/make/Makefile"
89+
targets_pattern="${{ matrix.stage }}"
90+
targets_pattern="${targets_pattern#2-experimental-}"
91+
export TARGETS_OPTIONAL=$( echo $(export PATH=build/bin:$PATH && (for a in spkg-install.in spkg-install requirements.txt; do sage-package list :experimental: --has-file $a --no-file huge --no-file has_nonfree_dependencies; done) | grep -v ^_ | grep -v sagemath_doc | grep "^[$targets_pattern]" ) )
92+
;;
93+
esac
94+
MAKE="make -j12" tox -e $TOX_ENV -- SAGE_NUM_THREADS=4 $TARGETS
95+
- name: Prepare logs artifact
96+
run: |
97+
mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; cp -r .tox/*/log "artifacts/$LOGS_ARTIFACT_NAME"
98+
if: always()
99+
- uses: actions/upload-artifact@v1
100+
with:
101+
path: artifacts
102+
name: ${{ env.LOGS_ARTIFACT_NAME }}
103+
if: always()
104+
- name: Print out logs for immediate inspection
105+
# and markup the output with GitHub Actions logging commands
106+
run: |
107+
.github/workflows/scan-logs.sh "artifacts/$LOGS_ARTIFACT_NAME"
108+
if: always()
109+
- name: Prepare sage-local artifact
110+
# This also includes the copies of homebrew or conda installed in the tox environment.
111+
# We use absolute pathnames in the tar file.
112+
# This is macOS tar -- cannot use --remove-files.
113+
# We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage.
114+
run: |
115+
mkdir -p sage-local-artifact && (cd .tox/$TOX_ENV && rm -f "local/lib64" && tar -cf - $(pwd)) > sage-local-artifact/sage-${{ env.TOX_ENV }}-${{ matrix.stage }}.tar
116+
if: contains(matrix.stage, '1')
117+
- uses: actions/upload-artifact@v2
118+
with:
119+
path: sage-local-artifact/sage-${{ env.TOX_ENV }}-${{ matrix.stage }}.tar
120+
name: ${{ env.LOCAL_ARTIFACT_NAME }}
121+
if: always()
122+
123+
dist:
124+
125+
runs-on: ubuntu-latest
126+
steps:
127+
- uses: actions/checkout@v2
128+
with:
129+
fetch-depth: 500
130+
- name: fetch tags
131+
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
132+
- name: Install bootstrap prerequisites
133+
run: |
134+
sudo DEBIAN_FRONTEND=noninteractive apt-get update
135+
sudo DEBIAN_FRONTEND=noninteractive apt-get install $(build/bin/sage-get-system-packages debian _bootstrap)
136+
- name: Bootstrap with sage-update-version
137+
# We set SAGE_ROOT and SAGE_SRC by hand
138+
# because 'sage -sh' does not work with an unconfigured tree,
139+
# giving: Error: SAGE_SCRIPTS_DIR is set to a bad value
140+
run: |
141+
git config --global user.email "[email protected]"
142+
git config --global user.name "Sage GitHub CI"
143+
SAGE_ROOT=. SAGE_SRC=./src src/bin/sage-update-version $(git describe) || echo "(ignoring error)"
144+
- name: make dist
145+
run: |
146+
./configure --enable-download-from-upstream-url && make dist
147+
- uses: actions/upload-artifact@v2
148+
with:
149+
path: "dist/*.tar.gz"
150+
name: dist
151+
152+
local-macos-nohomebrew:
153+
154+
needs: [dist]
155+
156+
runs-on: ${{ matrix.os }}
157+
strategy:
158+
fail-fast: false
159+
max-parallel: 4
160+
matrix:
161+
os: [ macos-10.15, macos-11.0 ]
162+
tox_system_factor: [macos-nobootstrap, macos-nobootstrap-python3_pythonorg]
163+
tox_packages_factor: [minimal]
164+
# As of 2021-03, default is 12.4
165+
# https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.md#xcode
166+
xcode_version_factor: [default]
167+
include:
168+
# Test xcode 11.7 only on macos-10.15
169+
- tox_system_factor: macos-nobootstrap
170+
tox_packages_factor: minimal
171+
xcode_version_factor: 11.7
172+
os: macos-10.15
173+
- tox_system_factor: macos-nobootstrap-python3_pythonorg
174+
tox_packages_factor: minimal
175+
xcode_version_factor: 11.7
176+
os: macos-10.15
177+
env:
178+
TOX_ENV: local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}
179+
LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}-xcode_${{ matrix.xcode_version_factor }}
180+
steps:
181+
- uses: actions/checkout@v2
182+
if: "!contains(matrix.tox_system_factor, 'nobootstrap')"
183+
- uses: actions/download-artifact@v2
184+
with:
185+
path: .
186+
name: dist
187+
if: contains(matrix.tox_system_factor, 'nobootstrap')
188+
- name: Unpack sage dist
189+
run: |
190+
tar xf sage*.tar.gz --strip-components=1
191+
if: contains(matrix.tox_system_factor, 'nobootstrap')
192+
- name: Move homebrew away
193+
run: |
194+
(cd /usr/local && for a in bin etc include lib opt sbin share; do sudo mv $a $a-moved; done)
195+
- name: Select Xcode version
196+
run: |
197+
if [ ${{ matrix.xcode_version_factor }} != default ]; then sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode_version_factor }}.app; fi
198+
- name: Install test prerequisites
199+
run: |
200+
sudo /usr/bin/python3 -m pip install tox
201+
- name: Install python3 from python.org
202+
# As of 2020-03-30 (https://github.com/actions/virtual-environments/blob/master/images/macos/macos-10.15-Readme.md),
203+
# Python 3.7.7 is installed on GitHub Actions runners. But we install our own copy from the python.org binary package.
204+
run: |
205+
curl -o python3.pkg https://www.python.org/ftp/python/3.7.7/python-3.7.7-macosx10.9.pkg
206+
sudo installer -verbose -pkg python3.pkg -target /
207+
if: contains(matrix.tox_system_factor, 'python3_pythonorg')
208+
- name: Build and test with tox
209+
# We use a high parallelization on purpose in order to catch possible parallelization bugs in the build scripts.
210+
# For doctesting, we use a lower parallelization to avoid timeouts.
211+
run: |
212+
MAKE="make -j12" tox -e $TOX_ENV -- SAGE_NUM_THREADS=4 $TARGETS
213+
- name: Prepare logs artifact
214+
run: |
215+
mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; cp -r .tox/*/log "artifacts/$LOGS_ARTIFACT_NAME"
216+
if: always()
217+
- uses: actions/upload-artifact@v1
218+
with:
219+
path: artifacts
220+
name: ${{ env.LOGS_ARTIFACT_NAME }}
221+
if: always()
222+
- name: Print out logs for immediate inspection
223+
# and markup the output with GitHub Actions logging commands
224+
run: |
225+
.github/workflows/scan-logs.sh "artifacts/$LOGS_ARTIFACT_NAME"
226+
if: always()

.github/workflows/cygwin.yml

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
name: Reusable workflow for Cygwin
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
targets_pre:
7+
default: build/make/Makefile
8+
type: string
9+
targets:
10+
type: string
11+
targets_optional:
12+
default: build/make/Makefile
13+
type: string
14+
prefix:
15+
required: false
16+
default: /opt/sage
17+
type: string
18+
toxenv:
19+
required: false
20+
default: local-cygwin-choco-standard
21+
type: string
22+
#
23+
# For use in multi-stage CIs
24+
#
25+
stage:
26+
required: false
27+
default: main
28+
type: string
29+
previous_stages:
30+
required: false
31+
type: string
32+
#
33+
# For use in upstream CIs
34+
#
35+
upstream_artifact:
36+
required: false
37+
type: string
38+
sage_repo:
39+
required: false
40+
type: string
41+
sage_trac_git:
42+
required: false
43+
type: string
44+
sage_trac_ticket:
45+
required: false
46+
type: string
47+
sage_ref:
48+
required: false
49+
type: string
50+
51+
jobs:
52+
stage:
53+
env:
54+
MAKE: make -j8
55+
SAGE_NUM_THREADS: 3
56+
CYGWIN: winsymlinks:native
57+
EXTRA_CONFIGURE_ARGS: --enable-fat-binary
58+
SAGE_LOCAL: ${{ inputs.prefix }}-${{ github.sha }}
59+
LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-${{ inputs.toxenv }}
60+
LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-${{ inputs.toxenv }}
61+
62+
runs-on: windows-latest
63+
64+
steps:
65+
- run: |
66+
git config --global core.autocrlf false
67+
git config --global core.symlinks true
68+
69+
- name: install cygwin with choco
70+
shell: bash {0}
71+
run: |
72+
choco --version
73+
choco install git python39 python39-pip --source cygwin
74+
75+
- name: Check out SageMath
76+
uses: actions/checkout@v2
77+
with:
78+
repository: ${{ inputs.sage_repo }}
79+
ref: ${{ inputs.sage_ref }}
80+
fetch-depth: 2000
81+
82+
- name: Check out git-trac-command
83+
uses: actions/checkout@v2
84+
with:
85+
repository: sagemath/git-trac-command
86+
path: git-trac-command
87+
if: inputs.sage_trac_git != ''
88+
- name: Check out SageMath from trac.sagemath.org
89+
shell: bash {0}
90+
# Random sleep and retry to limit the load on trac.sagemath.org
91+
run: |
92+
git config --global user.email "[email protected]"
93+
git config --global user.name "ci-sage workflow"
94+
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
95+
if: inputs.sage_trac_git != ''
96+
97+
- name: Download upstream artifact
98+
uses: actions/download-artifact@v2
99+
with:
100+
path: upstream
101+
name: ${{ inputs.upstream_artifact }}
102+
if: inputs.upstream_artifact
103+
- name: Update Sage packages from upstream artifact
104+
run: |
105+
C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && git config --global --add safe.directory $(pwd) && ls -l upstream/ && export PATH="$(pwd)/build/bin:$PATH:/usr/local/bin:/usr/bin" && (cd upstream && bash -x update-pkgs.sh) && git diff'
106+
if: inputs.upstream_artifact
107+
108+
- name: Download sage-local artifact
109+
uses: actions/download-artifact@v2
110+
with:
111+
name: ${{ env.LOCAL_ARTIFACT_NAME }}
112+
path: C:\\tools\\cygwin\\tmp
113+
if: inputs.previous_stages
114+
- name: Extract sage-local artifact
115+
run: |
116+
C:\\tools\\cygwin\\bin\\dash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && .github/workflows/extract-sage-local.sh /tmp/sage-local-*.tar && tar --create --listed-incremental=/tmp/sage-local.snar --file /dev/null "${{ env.SAGE_LOCAL }}"'
117+
if: inputs.previous_stages
118+
- name: tox
119+
run: |
120+
C:\\tools\\cygwin\\bin\\bash -l -x -c 'cat /proc/cpuinfo'
121+
C:\\tools\\cygwin\\bin\\bash -l -x -c 'python3.9 -m pip install tox'
122+
C:\\tools\\cygwin\\bin\\bash -l -x -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && PREFIX="${{ env.SAGE_LOCAL }}" TARGETS_PRE="${{ inputs.targets_pre }}" TARGETS_OPTIONAL="${{ inputs.targets_optional }}" tox -e ${{ inputs.toxenv }} -- ${{ inputs.targets }}'
123+
- name: Prepare logs artifact
124+
run: |
125+
C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; for a in "${{ env.SAGE_LOCAL }}"/var/tmp/sage/build/*; do if [ -d "$a" ]; then tar -c --remove-files -f "artifacts/$LOGS_ARTIFACT_NAME/"$(basename "$a")".tar" "$a"; fi; done; cp -r logs/* "artifacts/$LOGS_ARTIFACT_NAME"'
126+
if: always()
127+
- uses: actions/upload-artifact@v2
128+
with:
129+
path: artifacts
130+
name: ${{ env.LOGS_ARTIFACT_NAME }}
131+
if: always()
132+
- name: Print out logs for immediate inspection
133+
# The markup in the output is a GitHub Actions logging command
134+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions
135+
shell: bash
136+
run: |
137+
find "artifacts/$LOGS_ARTIFACT_NAME" -type f -name "*.log" -exec sh -c 'if tail -20 "{}" 2>/dev/null | grep "^Error" >/dev/null; then echo :":"error file={}:":" ==== LOG FILE {} CONTAINS AN ERROR ====; cat {} ; fi' \;
138+
if: always()
139+
- name: Prepare sage-local artifact
140+
# We specifically use the cygwin tar so that symlinks are saved/restored correctly on Windows.
141+
# We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage.
142+
run: |
143+
C:\\tools\\cygwin\\bin\\bash -l -c 'cd $(cygpath -u "$GITHUB_WORKSPACE") && rm -f "${{ env.SAGE_LOCAL }}"/lib64; tar -cf /tmp/sage-local-${{ inputs.stage }}.tar --listed-incremental=/tmp/sage-local.snar "${{ env.SAGE_LOCAL }}"'
144+
if: always()
145+
- uses: actions/upload-artifact@v2
146+
# upload-artifact@v2 does not support whitespace in file names.
147+
# so we tar up the directory ourselves
148+
with:
149+
path: C:\\tools\\cygwin\\tmp\\sage-local-${{ inputs.stage }}.tar
150+
name: ${{ env.LOCAL_ARTIFACT_NAME }}
151+
if: always()

0 commit comments

Comments
 (0)