Skip to content

Commit 91c6fa5

Browse files
committed
Merge branch 'develop' into p/36144/p/rework-on-live-sage-documentation
2 parents b5c20e8 + 1cf0c13 commit 91c6fa5

File tree

297 files changed

+1938
-1736
lines changed

Some content is hidden

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

297 files changed

+1938
-1736
lines changed

.ci/merge-fixes.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/sh
2+
# Merge open PRs from sagemath/sage labeled "blocker".
3+
REPO="sagemath/sage"
4+
GH="gh -R $REPO"
5+
PRs="$($GH pr list --label "p: blocker / 1" --json number --jq '.[].number')"
6+
if [ -z "$PRs" ]; then
7+
echo 'Nothing to do: Found no open PRs with "blocker" status.'
8+
else
9+
echo "Found PRs: " $PRs
10+
export GIT_AUTHOR_NAME="ci-sage workflow"
11+
export GIT_AUTHOR_EMAIL="[email protected]"
12+
export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
13+
export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
14+
git tag -f test_base
15+
git commit -q -m "Uncommitted changes" --no-allow-empty -a
16+
for a in $PRs; do
17+
echo "::group::Merging PR https://github.com/$REPO/pull/$a"
18+
git tag -f test_head
19+
$GH pr checkout -b pr-$a $a
20+
git fetch --unshallow --all
21+
git checkout -q test_head
22+
if git merge --no-edit --squash -q pr-$a; then
23+
echo "::endgroup::"
24+
if git commit -q -m "Merge https://github.com/$REPO/pull/$a" -a --no-allow-empty; then
25+
echo "Merged #$a"
26+
else
27+
echo "Empty, skipped"
28+
fi
29+
else
30+
echo "::endgroup::"
31+
echo "Failure merging #$a, resetting"
32+
git reset --hard
33+
fi
34+
done
35+
git log test_base..HEAD
36+
fi

.github/workflows/build.yml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,30 @@ concurrency:
2424
cancel-in-progress: true
2525

2626
jobs:
27+
get_ci_fixes:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
id: checkout
32+
uses: actions/checkout@v4
33+
- name: Merge CI fixes from sagemath/sage
34+
run: |
35+
.ci/merge-fixes.sh
36+
env:
37+
GH_TOKEN: ${{ github.token }}
38+
- name: Store CI fixes in upstream artifact
39+
run: |
40+
mkdir -p upstream
41+
git format-patch --stdout test_base > upstream/ci_fixes.patch
42+
- uses: actions/upload-artifact@v3
43+
with:
44+
path: upstream
45+
name: upstream
46+
2747
build:
2848
runs-on: ubuntu-latest
2949
container: ghcr.io/sagemath/sage/sage-${{ github.event.inputs.platform || 'ubuntu-focal-standard' }}-with-targets:${{ github.event.inputs.docker_tag || 'dev'}}
50+
needs: [get_ci_fixes]
3051
steps:
3152
- name: Checkout
3253
id: checkout
@@ -68,6 +89,19 @@ jobs:
6889
if [ ! -f worktree-image/.gitignore ]; then cp .gitignore worktree-image/; fi
6990
(cd worktree-image && 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)
7091
92+
- name: Download upstream artifact
93+
uses: actions/download-artifact@v3
94+
with:
95+
path: upstream
96+
name: upstream
97+
98+
- name: Apply CI fixes from sagemath/sage
99+
# After applying the fixes, make sure all changes are marked as uncommitted changes.
100+
run: |
101+
if [ -r upstream/ci_fixes.patch ]; then
102+
(cd worktree-image && git commit -q -m "current changes" --allow-empty -a && git am; git reset --quiet old; git add -N .) < upstream/ci_fixes.patch
103+
fi
104+
71105
- name: Incremental build, test changed files (sage -t --new)
72106
id: incremental
73107
run: |
@@ -76,15 +110,15 @@ jobs:
76110
./bootstrap && make build && ./sage -t --new -p2
77111
working-directory: ./worktree-image
78112
env:
79-
MAKE: make -j2
113+
MAKE: make -j2 --output-sync=recurse
80114
SAGE_NUM_THREADS: 2
81115

82116
- name: Build and test modularized distributions
83117
if: always() && steps.worktree.outcome == 'success'
84118
run: make V=0 tox && make pypi-wheels
85119
working-directory: ./worktree-image
86120
env:
87-
MAKE: make -j2
121+
MAKE: make -j2 --output-sync=recurse
88122
SAGE_NUM_THREADS: 2
89123

90124
- name: Set up node to install pyright
@@ -123,7 +157,7 @@ jobs:
123157
make build
124158
working-directory: ./worktree-image
125159
env:
126-
MAKE: make -j2
160+
MAKE: make -j2 --output-sync=recurse
127161
SAGE_NUM_THREADS: 2
128162

129163
- name: Pytest

.github/workflows/ci-conda.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ jobs:
5151
steps:
5252
- uses: actions/checkout@v4
5353

54+
- name: Merge CI fixes from sagemath/sage
55+
run: |
56+
.ci/merge-fixes.sh
57+
env:
58+
GH_TOKEN: ${{ github.token }}
59+
5460
- name: Check for Miniconda
5561
id: check_conda
5662
run: echo ::set-output name=installed::$CONDA
@@ -99,9 +105,6 @@ jobs:
99105
echo "::remove-matcher owner=configure-system-package-warning::"
100106
echo "::remove-matcher owner=configure-system-package-error::"
101107
102-
# Manually install ptyprocess for now, until https://github.com/sagemath/sage/issues/32147 is fixed
103-
pip install --no-build-isolation -v -v ptyprocess==0.5.1
104-
105108
- name: Build
106109
shell: bash -l {0}
107110
run: |

.github/workflows/ci-linux-incremental.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ jobs:
6060
echo "uninstall_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.configures_all_changed_files }}; do echo $a | sed -E 's,build/pkgs/([_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'; done | sort -u))" >> $GITHUB_OUTPUT
6161
echo "build_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.pkgs_all_changed_files }}; do echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([-_.a-z0-9]*)/[^ ]* *,\2-ensure,;'; done | sort -u))" >> $GITHUB_OUTPUT
6262
cat $GITHUB_OUTPUT
63-
minimal:
63+
64+
test:
6465
needs: [changed_files]
6566
if: |
6667
github.event_name != 'pull_request' ||
@@ -94,3 +95,38 @@ jobs:
9495
["standard",
9596
"minimal"]
9697
docker_push_repository: ghcr.io/${{ github.repository }}/
98+
99+
site:
100+
needs: [changed_files]
101+
if: |
102+
github.event_name != 'pull_request' ||
103+
((github.event.action != 'labeled' &&
104+
(contains(github.event.pull_request.labels.*.name, 'c: packages: standard') ||
105+
contains(github.event.pull_request.labels.*.name, 'c: packages: optional'))) ||
106+
(github.event.action == 'labeled' &&
107+
(github.event.label.name == 'c: packages: optional' ||
108+
github.event.label.name == 'c: packages: standard')))
109+
uses: ./.github/workflows/docker.yml
110+
with:
111+
# Build incrementally from published Docker image
112+
incremental: true
113+
free_disk_space: true
114+
from_docker_repository: ghcr.io/sagemath/sage/
115+
from_docker_target: "with-targets"
116+
from_docker_tag: "dev"
117+
docker_targets: "with-targets"
118+
targets: "${{needs.changed_files.outputs.uninstall_targets}} ${{needs.changed_files.outputs.build_targets}} build doc-html ptest"
119+
# Only test systems with a usable system python (>= 3.9)
120+
tox_system_factors: >-
121+
["ubuntu-jammy",
122+
"ubuntu-mantic",
123+
"debian-bullseye",
124+
"debian-bookworm",
125+
"fedora-33",
126+
"fedora-38",
127+
"gentoo-python3.11",
128+
"archlinux",
129+
"debian-bullseye-i386"]
130+
tox_packages_factors: >-
131+
["standard-sitepackages"]
132+
docker_push_repository: ghcr.io/${{ github.repository }}/

.github/workflows/ci-macos.yml

Lines changed: 33 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -30,89 +30,40 @@ env:
3030
TARGETS_OPTIONAL: ptest
3131

3232
jobs:
33-
local-macos:
33+
stage-1:
34+
uses: ./.github/workflows/macos.yml
35+
with:
36+
stage: "1"
3437

35-
runs-on: ${{ matrix.os }}
36-
strategy:
37-
fail-fast: false
38-
matrix:
39-
stage: ["1", "2", "2-optional-0-o", "2-optional-p-z", "2-experimental-0-o", "2-experimental-p-z"]
40-
# python3_xcode is only accepted if enough packages are available from the system
41-
# --> to test "minimal", we would need https://github.com/sagemath/sage/issues/30949
42-
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]
43-
xcode_version_factor: [default]
44-
os: [ macos-11, macos-12 ]
45-
env:
46-
TOX_ENV: local-${{ matrix.tox_env }}
47-
LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-tox-local-${{ matrix.tox_env }}-${{ matrix.os }}-xcode_${{ matrix.xcode_version_factor }}
48-
LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-local-${{ matrix.tox_env }}--${{ matrix.os }}-xcode_${{ matrix.xcode_version_factor }}
49-
steps:
50-
- uses: actions/checkout@v4
51-
- name: Select Xcode version
52-
run: |
53-
if [ ${{ matrix.xcode_version_factor }} != default ]; then sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode_version_factor }}.app; fi
54-
- name: Install test prerequisites
55-
run: |
56-
brew install tox
57-
- uses: actions/download-artifact@v3
58-
with:
59-
path: sage-local-artifact
60-
name: ${{ env.LOCAL_ARTIFACT_NAME }}
61-
if: contains(matrix.stage, '2')
62-
- name: Extract sage-local artifact
63-
# This is macOS tar -- cannot use --listed-incremental
64-
run: |
65-
export SAGE_LOCAL=$(pwd)/.tox/$TOX_ENV/local
66-
.github/workflows/extract-sage-local.sh sage-local-artifact/sage-local-*.tar
67-
if: contains(matrix.stage, '2')
68-
- name: Build and test with tox
69-
# We use a high parallelization on purpose in order to catch possible parallelization bugs in the build scripts.
70-
# For doctesting, we use a lower parallelization to avoid timeouts.
71-
run: |
72-
case "${{ matrix.stage }}" in
73-
1) export TARGETS_PRE="all-sage-local" TARGETS="all-sage-local" TARGETS_OPTIONAL="build/make/Makefile"
74-
;;
75-
2) export TARGETS_PRE="all-sage-local" TARGETS="build doc-html" TARGETS_OPTIONAL="ptest"
76-
;;
77-
2-optional*) export TARGETS_PRE="build/make/Makefile" TARGETS="build/make/Makefile"
78-
targets_pattern="${{ matrix.stage }}"
79-
targets_pattern="${targets_pattern#2-optional-}"
80-
export TARGETS_OPTIONAL=$( echo $(export PATH=build/bin:$PATH && sage-package list :optional: --has-file 'spkg-install.in|spkg-install|requirements.txt' --no-file huge|has_nonfree_dependencies | grep -v sagemath_doc | grep "^[$targets_pattern]" ) )
81-
;;
82-
2-experimental*) export TARGETS_PRE="build/make/Makefile" TARGETS="build/make/Makefile"
83-
targets_pattern="${{ matrix.stage }}"
84-
targets_pattern="${targets_pattern#2-experimental-}"
85-
export TARGETS_OPTIONAL=$( echo $(export PATH=build/bin:$PATH && sage-package list :experimental: --has-file 'spkg-install.in|spkg-install|requirements.txt' --no-file huge|has_nonfree_dependencies | grep -v sagemath_doc | grep "^[$targets_pattern]" ) )
86-
;;
87-
esac
88-
MAKE="make -j12" tox -e $TOX_ENV -- SAGE_NUM_THREADS=4 $TARGETS
89-
- name: Prepare logs artifact
90-
run: |
91-
mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; cp -r .tox/*/log "artifacts/$LOGS_ARTIFACT_NAME"
92-
if: always()
93-
- uses: actions/upload-artifact@v3
94-
with:
95-
path: artifacts
96-
name: ${{ env.LOGS_ARTIFACT_NAME }}
97-
if: always()
98-
- name: Print out logs for immediate inspection
99-
# and markup the output with GitHub Actions logging commands
100-
run: |
101-
.github/workflows/scan-logs.sh "artifacts/$LOGS_ARTIFACT_NAME"
102-
if: always()
103-
- name: Prepare sage-local artifact
104-
# This also includes the copies of homebrew or conda installed in the tox environment.
105-
# We use absolute pathnames in the tar file.
106-
# This is macOS tar -- cannot use --remove-files.
107-
# We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage.
108-
run: |
109-
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
110-
if: contains(matrix.stage, '1')
111-
- uses: actions/upload-artifact@v3
112-
with:
113-
path: sage-local-artifact/sage-${{ env.TOX_ENV }}-${{ matrix.stage }}.tar
114-
name: ${{ env.LOCAL_ARTIFACT_NAME }}
115-
if: always()
38+
stage-2:
39+
uses: ./.github/workflows/macos.yml
40+
with:
41+
stage: "2"
42+
needs: [stage-1]
43+
44+
stage-2-optional-0-o:
45+
uses: ./.github/workflows/macos.yml
46+
with:
47+
stage: "2-optional-0-o"
48+
needs: [stage-2]
49+
50+
stage-2-optional-p-z:
51+
uses: ./.github/workflows/macos.yml
52+
with:
53+
stage: "2-optional-p-z"
54+
needs: [stage-2-optional-0-o]
55+
56+
stage-2-experimental-0-o:
57+
uses: ./.github/workflows/macos.yml
58+
with:
59+
stage: "2-optional-0-o"
60+
needs: [stage-2-optional-p-z]
61+
62+
stage-2-experimental-p-z:
63+
uses: ./.github/workflows/macos.yml
64+
with:
65+
stage: "2-experimental-p-z"
66+
needs: [stage-2-experimental-0-o]
11667

11768
dist:
11869

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ jobs:
2121
- name: Checkout
2222
uses: actions/checkout@v4
2323

24+
- name: Merge CI fixes from sagemath/sage
25+
run: |
26+
.ci/merge-fixes.sh
27+
env:
28+
GH_TOKEN: ${{ github.token }}
29+
2430
- name: Prepare
2531
run: |
2632
apt-get update && apt-get install -y zip

0 commit comments

Comments
 (0)