Skip to content

Commit b275f17

Browse files
authored
Merge branch 'develop' into imports-total
2 parents 58a2561 + e0cf1e4 commit b275f17

File tree

1,356 files changed

+40894
-40323
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,356 files changed

+40894
-40323
lines changed

.ci/write-dockerfile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ cat <<EOF
275275
FROM with-system-packages AS bootstrapped
276276
#:bootstrapping:
277277
RUN rm -rf /new /sage/.git
278-
$ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap configure.ac sage .homebrew-build-env tox.ini .gitignore /new/
278+
$ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap conftest.py configure_wrapper configure.ac sage .homebrew-build-env tox.ini .gitignore /new/
279279
$ADD config/config.rpath /new/config/config.rpath
280280
$ADD src/doc/bootstrap /new/src/doc/bootstrap
281281
$ADD src/bin /new/src/bin

.devcontainer/onCreate-conda.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ mamba env create -y --file environment-3.11-linux.yml || mamba env update -y --f
1010
conda init bash
1111

1212
# Build sage
13-
conda run -n sage-dev ./bootstrap
14-
conda run -n sage-dev pip install --no-build-isolation -v -v -e ./src
13+
conda run -n sage-dev pip install --no-build-isolation -v -v -e .

.github/workflows/build.yml

Lines changed: 7 additions & 286 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
platform:
1616
description: 'Platform'
1717
required: true
18-
default: 'ubuntu-jammy-standard'
18+
default: 'ubuntu-noble-standard'
1919
docker_tag:
2020
description: 'Docker tag'
2121
required: true
@@ -29,7 +29,7 @@ concurrency:
2929
#
3030
# The three workflows:
3131
#
32-
# - build.yml (with jobs test-new, test-mod, test-long),
32+
# - build.yml (with jobs test-new, test-long),
3333
# - doc-build.yml,
3434
# - doc-build-pdf.yml
3535
#
@@ -50,7 +50,7 @@ concurrency:
5050
# This baseline is transparently improved by our use of the GH Actions cache,
5151
# see https://docs.docker.com/build/ci/github-actions/cache/#cache-backend-api.
5252
#
53-
# Jobs test-mod and test-long are only started after test-new completed;
53+
# Jobs test-long is only started after test-new completed;
5454
# but the workflows doc-build.yml and doc-build-pdf.yml are started independently.
5555
#
5656
# - When nothing is cached and the 3 workflows are launched in parallel,
@@ -68,293 +68,16 @@ concurrency:
6868

6969
env:
7070
# Adapted from docker.yml
71-
TOX_ENV: "docker-${{ github.event.inputs.platform || 'ubuntu-jammy-standard' }}-incremental"
72-
BUILD_IMAGE: "localhost:5000/${{ github.repository }}/sage-${{ github.event.inputs.platform || 'ubuntu-jammy-standard' }}-with-targets:ci"
71+
TOX_ENV: "docker-${{ github.event.inputs.platform || 'ubuntu-noble-standard' }}-incremental"
72+
BUILD_IMAGE: "localhost:5000/${{ github.repository }}/sage-${{ github.event.inputs.platform || 'ubuntu-noble-standard' }}-with-targets:ci"
7373
FROM_DOCKER_REPOSITORY: "ghcr.io/sagemath/sage/"
7474
FROM_DOCKER_TARGET: "with-targets"
7575
FROM_DOCKER_TAG: ${{ github.event.inputs.docker_tag || 'dev'}}
7676
EXTRA_CONFIGURE_ARGS: --enable-fat-binary
7777

7878
jobs:
79-
test-new:
80-
runs-on: ubuntu-latest
81-
outputs:
82-
build_targets: ${{ steps.build-targets.outputs.build_targets }}
83-
services:
84-
# https://docs.docker.com/build/ci/github-actions/local-registry/
85-
registry:
86-
image: registry:2
87-
ports:
88-
- 5000:5000
89-
steps:
90-
- name: Maximize build disk space
91-
uses: easimon/maximize-build-space@v10
92-
with:
93-
# need space in /var for Docker images
94-
root-reserve-mb: 30000
95-
remove-dotnet: true
96-
remove-android: true
97-
remove-haskell: true
98-
remove-codeql: true
99-
remove-docker-images: true
100-
101-
- name: Checkout
102-
id: checkout
103-
uses: actions/checkout@v4
104-
105-
- name: Get changed files and packages
106-
id: changed-files
107-
uses: tj-actions/changed-files@v45
108-
with:
109-
# File extensions for doctests per sage.doctest.control.skipfile
110-
files_yaml: |
111-
configures:
112-
- 'build/pkgs/*/spkg-configure.m4'
113-
pkgs:
114-
- 'build/pkgs/**'
115-
- '!build/pkgs/_**'
116-
- '!build/pkgs/configure/**'
117-
- 'pkgs/**'
118-
doctests:
119-
- 'src/**/*.{py,pyx,pxd,pxi,sage,spyx,rst,tex}'
120-
- '!src/{setup,conftest*}.py'
121-
122-
- name: Determine targets to build
123-
id: build-targets
124-
run: |
125-
uninstall_targets=$(echo $(
126-
for a in '' ${{ steps.changed-files.outputs.configures_all_changed_files }}; do
127-
# Extract package name from the file path and append '-uninstall'
128-
echo $a | sed -E 's,build/pkgs/([a-z0-9][_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'
129-
done | sort -u # Sort and ensure uniqueness
130-
))
131-
build_targets=$(echo $(
132-
for a in '' ${{ steps.changed-files.outputs.pkgs_all_changed_files }}; do
133-
# Extract package name, replace '-' with '_', and strip extra parts from the path
134-
SPKG=$(echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([a-z0-9][-_.a-z0-9]*)/[^ ]* *,\2,;')
135-
# Check if key files exist in the package directory
136-
if [ -f "build/pkgs/$SPKG/checksums.ini" ] || \
137-
[ -f "build/pkgs/$SPKG/requirements.txt" ] || \
138-
[ -f "build/pkgs/$SPKG/spkg-install" ]; then
139-
echo "$SPKG-ensure" # add the "$SPKG-ensure" target
140-
fi
141-
done | sort -u # Sort and ensure uniqueness
142-
))
143-
if [ -n "$uninstall_targets" ]; then
144-
echo "build_targets=$uninstall_targets reconfigure $build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT
145-
else
146-
echo "build_targets=$build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT
147-
fi
148-
cat $GITHUB_OUTPUT
149-
150-
- uses: actions/checkout@v4
151-
with:
152-
ref: ${{ github.base_ref }}
153-
path: worktree-base
154-
if: github.base_ref && steps.changed-files.outputs.pkgs_all_changed_files
155-
156-
- name: Compute metrics
157-
run: |
158-
export PATH=build/bin:$PATH
159-
if [ -d worktree-base ]; then
160-
(echo "# $GITHUB_BASE_REF"; SAGE_ROOT=worktree-base sage-package metrics :all:) > base-metrics.txt
161-
(echo "# $GITHUB_REF"; sage-package metrics :all:) > metrics.txt
162-
diff --color=always --width=100 --side-by-side --left-column base-metrics.txt metrics.txt || true
163-
else
164-
sage-package metrics :all:
165-
fi
166-
167-
- name: Install test prerequisites
168-
# From docker.yml
169-
run: |
170-
sudo DEBIAN_FRONTEND=noninteractive apt-get update
171-
sudo DEBIAN_FRONTEND=noninteractive apt-get install tox
172-
sudo apt-get clean
173-
df -h
174-
175-
- name: Merge CI fixes from sagemath/sage
176-
# From docker.yml
177-
# This step needs to happen after the commit sha is put in DOCKER_TAG
178-
# so that multi-stage builds can work correctly.
179-
run: |
180-
mkdir -p upstream
181-
.ci/merge-fixes.sh 2>&1 | tee upstream/ci_fixes.log
182-
env:
183-
GH_TOKEN: ${{ github.token }}
184-
SAGE_CI_FIXES_FROM_REPOSITORIES: ${{ vars.SAGE_CI_FIXES_FROM_REPOSITORIES }}
185-
186-
# Building
187-
188-
- name: Generate Dockerfile
189-
# From docker.yml
190-
run: |
191-
tox -e ${{ env.TOX_ENV }}
192-
cp .tox/${{ env.TOX_ENV }}/Dockerfile .
193-
env:
194-
# Only generate the Dockerfile, do not run 'docker build' here
195-
DOCKER_TARGETS: ""
196-
197-
- name: Set up Docker Buildx
198-
uses: docker/setup-buildx-action@v3
199-
with:
200-
driver-opts: network=host
201-
202-
- name: Build Docker image
203-
id: image
204-
uses: docker/build-push-action@v6
205-
with:
206-
# push and load may not be set together at the moment
207-
#
208-
# We are using "push" (to the local registry) because it was
209-
# more reliable than "load", for which we observed random failure
210-
# conditions in which the built image could not be found.
211-
#
212-
push: ${{ steps.changed-files.outputs.doctests_all_changed_files && true || false }}
213-
load: false
214-
context: .
215-
tags: ${{ env.BUILD_IMAGE }}
216-
target: with-targets
217-
cache-from: type=gha
218-
cache-to: type=gha,mode=max
219-
build-args: |
220-
NUMPROC=6
221-
USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse
222-
TARGETS_PRE=build/make/Makefile
223-
TARGETS=${{ steps.build-targets.outputs.build_targets }}
224-
225-
- name: Start container
226-
id: container
227-
# Try to continue when "exporting to GitHub Actions Cache" failed with timeout
228-
if: (success() || failure()) && steps.changed-files.outputs.doctests_all_changed_files
229-
run: |
230-
docker run --name BUILD -dit \
231-
--mount type=bind,src=$(pwd),dst=$(pwd) \
232-
--workdir $(pwd) \
233-
${{ env.BUILD_IMAGE }} /bin/sh
234-
235-
# Testing
236-
237-
- name: Check that all modules can be imported
238-
if: (success() || failure()) && steps.container.outcome == 'success' && steps.changed-files.outputs.doctests_all_changed_files
239-
run: |
240-
# Increase the length of the lines in the "short summary"
241-
export COLUMNS=120
242-
# The following command checks that all modules can be imported.
243-
# The output also includes a long list of modules together with the number of tests in each module.
244-
# This can be ignored.
245-
./sage -python -m pip install pytest-xdist
246-
./sage -python -m pytest -c tox.ini -qq --doctest --collect-only || true
247-
shell: sh .ci/docker-exec-script.sh BUILD /sage {0}
248-
249-
- name: Test changed files (sage -t --new)
250-
if: (success() || failure()) && steps.container.outcome == 'success' && steps.changed-files.outputs.doctests_all_changed_files
251-
run: |
252-
export MAKE="make -j2 --output-sync=recurse" SAGE_NUM_THREADS=4
253-
# https://github.com/tj-actions/changed-files?tab=readme-ov-file#outputs-
254-
./sage -t --long --format github -p4 ${{ steps.changed-files.outputs.doctests_all_changed_files }}
255-
shell: sh .ci/docker-exec-script.sh BUILD /sage {0}
256-
257-
test-mod:
258-
runs-on: ubuntu-latest
259-
needs: [test-new]
260-
services:
261-
# https://docs.docker.com/build/ci/github-actions/local-registry/
262-
registry:
263-
image: registry:2
264-
ports:
265-
- 5000:5000
266-
strategy:
267-
fail-fast: false
268-
matrix:
269-
targets:
270-
- sagemath_categories-check
271-
steps:
272-
- name: Maximize build disk space
273-
uses: easimon/maximize-build-space@v10
274-
with:
275-
# need space in /var for Docker images
276-
root-reserve-mb: 30000
277-
remove-dotnet: true
278-
remove-android: true
279-
remove-haskell: true
280-
remove-codeql: true
281-
remove-docker-images: true
282-
283-
- name: Checkout
284-
id: checkout
285-
uses: actions/checkout@v4
286-
287-
- name: Install test prerequisites
288-
# From docker.yml
289-
run: |
290-
sudo DEBIAN_FRONTEND=noninteractive apt-get update
291-
sudo DEBIAN_FRONTEND=noninteractive apt-get install tox
292-
sudo apt-get clean
293-
df -h
294-
295-
- name: Merge CI fixes from sagemath/sage
296-
# From docker.yml
297-
# This step needs to happen after the commit sha is put in DOCKER_TAG
298-
# so that multi-stage builds can work correctly.
299-
run: |
300-
.ci/merge-fixes.sh
301-
env:
302-
GH_TOKEN: ${{ github.token }}
303-
304-
# Building
305-
306-
- name: Generate Dockerfile
307-
# From docker.yml
308-
run: |
309-
tox -e ${{ env.TOX_ENV }}
310-
cp .tox/${{ env.TOX_ENV }}/Dockerfile .
311-
env:
312-
# Only generate the Dockerfile, do not run 'docker build' here
313-
DOCKER_TARGETS: ""
314-
315-
- name: Set up Docker Buildx
316-
uses: docker/setup-buildx-action@v3
317-
with:
318-
driver-opts: network=host
319-
320-
- name: Build Docker image
321-
id: image
322-
uses: docker/build-push-action@v6
323-
with:
324-
push: true
325-
load: false
326-
context: .
327-
tags: ${{ env.BUILD_IMAGE }}
328-
target: with-targets
329-
cache-from: type=gha
330-
cache-to: type=gha,mode=max
331-
build-args: |
332-
NUMPROC=6
333-
USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse
334-
TARGETS_PRE=build/make/Makefile
335-
TARGETS=${{ needs.test-new.outputs.build_targets }}
336-
337-
- name: Start container
338-
id: container
339-
if: (success() || failure())
340-
run: |
341-
docker run --name BUILD -dit \
342-
--mount type=bind,src=$(pwd),dst=$(pwd) \
343-
--workdir $(pwd) \
344-
${{ env.BUILD_IMAGE }} /bin/sh
345-
346-
# Testing
347-
348-
- name: Test modularized distributions
349-
if: (success() || failure()) && steps.container.outcome == 'success'
350-
run: |
351-
export MAKE="make -j2 --output-sync=recurse" SAGE_NUM_THREADS=4
352-
make V=0 tox-ensure && make ${{ matrix.targets }}
353-
shell: sh .ci/docker-exec-script.sh BUILD /sage {0}
354-
35579
test-long:
35680
runs-on: ubuntu-latest
357-
needs: [test-new]
35881
services:
35982
# https://docs.docker.com/build/ci/github-actions/local-registry/
36083
registry:
@@ -406,6 +129,8 @@ jobs:
406129

407130
- name: Generate Dockerfile
408131
# From docker.yml
132+
# tox -e <environment name> command runs commands in `tox.ini`,
133+
# in particular the script `.ci/write-dockerfile.sh`, to generate `Dockerfile`.
409134
run: |
410135
tox -e ${{ env.TOX_ENV }}
411136
cp .tox/${{ env.TOX_ENV }}/Dockerfile .
@@ -427,8 +152,6 @@ jobs:
427152
context: .
428153
tags: ${{ env.BUILD_IMAGE }}
429154
target: with-targets
430-
cache-from: type=gha
431-
cache-to: type=gha,mode=max
432155
build-args: |
433156
NUMPROC=6
434157
USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse
@@ -547,8 +270,6 @@ jobs:
547270
context: .
548271
tags: ${{ env.BUILD_IMAGE }}
549272
target: with-targets
550-
cache-from: type=gha
551-
cache-to: type=gha,mode=max
552273
build-args: |
553274
NUMPROC=6
554275
USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse

0 commit comments

Comments
 (0)