Skip to content

Commit 84de1a5

Browse files
authored
Merge branch 'develop' into pyprojecttoml
2 parents af846d2 + 7726cd9 commit 84de1a5

File tree

233 files changed

+2320
-1109
lines changed

Some content is hidden

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

233 files changed

+2320
-1109
lines changed

.ci/write-dockerfile.sh

+44-42
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ STRIP_COMMENTS="sed s/#.*//;"
3535
SAGE_ROOT=.
3636
export PATH="$SAGE_ROOT"/build/bin:$PATH
3737
SYSTEM_PACKAGES=$EXTRA_SYSTEM_PACKAGES
38-
SYSTEM_CONFIGURE_ARGS="--enable-option-checking "
38+
SYSTEM_CONFIGURE_ARGS=" --enable-option-checking"
3939
for SPKG in $(sage-package list --has-file=spkg-configure.m4 $SAGE_PACKAGE_LIST_ARGS) $EXTRA_SAGE_PACKAGES; do
4040
SYSTEM_PACKAGE=$(sage-get-system-packages $SYSTEM $SPKG)
4141
if [ -n "${SYSTEM_PACKAGE}" ]; then
@@ -45,13 +45,20 @@ for SPKG in $(sage-package list --has-file=spkg-configure.m4 $SAGE_PACKAGE_LIST_
4545
# shell-quote package if necessary
4646
SYSTEM_PACKAGES+=$(printf " %q" "$a")
4747
done
48-
SYSTEM_CONFIGURE_ARGS+="--with-system-${SPKG}=${WITH_SYSTEM_SPKG} "
48+
# Check if SPKG is not a dummy package
49+
if [[ $SPKG != _* ]]; then
50+
SYSTEM_CONFIGURE_ARGS+=" --with-system-${SPKG}=${WITH_SYSTEM_SPKG}"
51+
fi
4952
fi
5053
done
5154
echo "# Automatically generated by SAGE_ROOT/.ci/write-dockerfile.sh"
5255
echo "# the :comments: separate the generated file into sections"
5356
echo "# to simplify writing scripts that customize this file"
54-
ADD="ADD $__CHOWN"
57+
if [ -z "$__CHOWN" ]; then
58+
ADD="ADD"
59+
else
60+
ADD="ADD $__CHOWN"
61+
fi
5562
RUN=RUN
5663
cat <<EOF
5764
ARG BASE_IMAGE=$(eval echo "${FULL_BASE_IMAGE_AND_TAG}")
@@ -86,10 +93,7 @@ case $SYSTEM in
8693
# we remove the unminimize binary here after it has done its job.
8794
#
8895
cat <<EOF
89-
RUN if command -v unminimize > /dev/null; then \
90-
(yes | unminimize) || echo "(ignored)"; \
91-
rm -f "\$(command -v unminimize)"; \
92-
fi
96+
RUN if command -v unminimize > /dev/null; then (yes | unminimize) || echo "(ignored)"; rm -f "\$(command -v unminimize)"; fi
9397
EOF
9498
if [ -n "$DIST_UPGRADE" ]; then
9599
cat <<EOF
@@ -254,10 +258,10 @@ case ${DOCKER_BUILDKIT-0} in
254258
# With buildkit we cannot retrieve failed builds.
255259
# So we do not allow the main step of a build stage to fail.
256260
# Instead we record the exit code in the file STATUS.
257-
THEN_SAVE_STATUS='; echo $? > STATUS'
261+
THEN_SAVE_STATUS=' ; echo $? > STATUS'
258262
# ... and at the beginning of the next build stage,
259263
# we check the status and exit with an error status.
260-
CHECK_STATUS_THEN='STATUS=$(cat STATUS 2>/dev/null); case "$STATUS" in ""|0) ;; *) exit $STATUS;; esac; '
264+
CHECK_STATUS_THEN=' STATUS=$(cat STATUS 2>/dev/null); case "$STATUS" in ""|0) ;; *) exit $STATUS;; esac;'
261265
esac
262266

263267
if [ -n "$GITHUB_ACTIONS" ]; then
@@ -281,38 +285,37 @@ $ADD pkgs /new/pkgs
281285
$ADD build /new/build
282286
$ADD .upstream.d /new/.upstream.d
283287
ADD .ci /.ci
284-
RUN if [ -d /sage ]; then \
285-
echo "### Incremental build from \$(cat /sage/VERSION.txt)" && \
286-
printf '/src/*\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /sage/.gitignore && \
287-
printf '/src/*\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /new/.gitignore && \
288-
if ! (cd /new && /.ci/retrofit-worktree.sh worktree-image /sage); then \
289-
echo "retrofit-worktree.sh failed, falling back to replacing /sage"; \
290-
for a in local logs; do \
291-
if [ -d /sage/\$a ]; then mv /sage/\$a /new/; fi; \
292-
done; \
293-
rm -rf /sage; \
294-
mv /new /sage; \
295-
fi; \
296-
else \
297-
mv /new /sage; \
288+
RUN if [ -d /sage ]; then \\
289+
echo "### Incremental build from \$(cat /sage/VERSION.txt)" && \\
290+
printf '/src/*\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /sage/.gitignore && \\
291+
printf '/src/*\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /new/.gitignore && \\
292+
if ! (cd /new && /.ci/retrofit-worktree.sh worktree-image /sage); then \\
293+
echo "retrofit-worktree.sh failed, falling back to replacing /sage"; \\
294+
for a in local logs; do \\
295+
if [ -d /sage/\$a ]; then mv /sage/\$a /new/; fi; \\
296+
done; \\
297+
rm -rf /sage; \\
298+
mv /new /sage; \\
299+
fi; \\
300+
else \\
301+
mv /new /sage; \\
298302
fi
299303
WORKDIR /sage
300-
301304
ARG BOOTSTRAP="${BOOTSTRAP-./bootstrap}"
302-
$RUN sh -x -c "\${BOOTSTRAP}" $ENDRUN $THEN_SAVE_STATUS
305+
$RUN sh -x -c "\${BOOTSTRAP}"$ENDRUN$THEN_SAVE_STATUS
303306
304307
FROM bootstrapped AS configured
305308
#:configuring:
306-
RUN $CHECK_STATUS_THEN mkdir -p logs/pkgs; rm -f config.log; ln -s logs/pkgs/config.log config.log
309+
RUN$CHECK_STATUS_THEN mkdir -p logs/pkgs; rm -f config.log; ln -s logs/pkgs/config.log config.log
307310
ARG CONFIGURE_ARGS="${CONFIGURE_ARGS:---enable-build-as-root}"
308311
EOF
309312
if [ ${WITH_SYSTEM_SPKG} = "force" ]; then
310313
cat <<EOF
311-
$RUN ./configure $SYSTEM_CONFIGURE_ARGS \${CONFIGURE_ARGS} || (echo "::group::config.log"; cat config.log; echo "::endgroup::"; echo "********** configuring without forcing ***********"; ./configure \${CONFIGURE_ARGS}; echo "::group::config.log"; cat config.log; echo "::endgroup::"; exit 1) $ENDRUN $THEN_SAVE_STATUS
314+
$RUN ./configure $SYSTEM_CONFIGURE_ARGS \${CONFIGURE_ARGS} || (echo "::group::config.log"; cat config.log; echo "::endgroup::"; echo "********** configuring without forcing ***********"; ./configure \${CONFIGURE_ARGS}; echo "::group::config.log"; cat config.log; echo "::endgroup::"; exit 1)$ENDRUN$THEN_SAVE_STATUS
312315
EOF
313316
else
314317
cat <<EOF
315-
$RUN ./configure $SYSTEM_CONFIGURE_ARGS \${CONFIGURE_ARGS} || (echo "::group::config.log"; cat config.log; echo "::endgroup::"; exit 1) $ENDRUN $THEN_SAVE_STATUS
318+
$RUN ./configure $SYSTEM_CONFIGURE_ARGS \${CONFIGURE_ARGS} || (echo "::group::config.log"; cat config.log; echo "::endgroup::"; exit 1)$ENDRUN$THEN_SAVE_STATUS
316319
EOF
317320
fi
318321
cat <<EOF
@@ -325,7 +328,7 @@ ARG USE_MAKEFLAGS="-k V=0"
325328
ENV SAGE_CHECK=warn
326329
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst"
327330
#:toolchain:
328-
$RUN $CHECK_STATUS_THEN make \${USE_MAKEFLAGS} base-toolchain $ENDRUN $THEN_SAVE_STATUS
331+
$RUN$CHECK_STATUS_THEN make \${USE_MAKEFLAGS} base-toolchain$ENDRUN$THEN_SAVE_STATUS
329332
330333
FROM with-base-toolchain AS with-targets-pre
331334
ARG NUMPROC=8
@@ -335,7 +338,7 @@ ENV SAGE_CHECK=warn
335338
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst"
336339
#:make:
337340
ARG TARGETS_PRE="all-sage-local"
338-
$RUN $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_PRE} $ENDRUN $THEN_SAVE_STATUS
341+
$RUN$CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_PRE}$ENDRUN$THEN_SAVE_STATUS
339342
340343
FROM with-targets-pre AS with-targets
341344
ARG NUMPROC=8
@@ -345,19 +348,18 @@ ENV SAGE_CHECK=warn
345348
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst"
346349
$ADD .gitignore /new/.gitignore
347350
$ADD src /new/src
348-
RUN cd /new && rm -rf .git && \
349-
if /.ci/retrofit-worktree.sh worktree-pre /sage; then \
350-
cd /sage && touch configure build/make/Makefile; \
351-
else \
352-
echo "retrofit-worktree.sh failed, falling back to replacing /sage/src"; \
353-
rm -rf /sage/src; \
354-
mv src /sage/src; \
355-
cd /sage && ./bootstrap && ./config.status; \
356-
fi; \
351+
RUN cd /new && rm -rf .git && \\
352+
if /.ci/retrofit-worktree.sh worktree-pre /sage; then \\
353+
cd /sage && touch configure build/make/Makefile; \\
354+
else \\
355+
echo "retrofit-worktree.sh failed, falling back to replacing /sage/src"; \\
356+
rm -rf /sage/src; \\
357+
mv src /sage/src; \\
358+
cd /sage && ./bootstrap && ./config.status; \\
359+
fi; \\
357360
cd /sage && rm -rf .git; rm -rf /new || echo "(error ignored)"
358-
359361
ARG TARGETS="build"
360-
$RUN $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS} $ENDRUN $THEN_SAVE_STATUS
362+
$RUN$CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS}$ENDRUN$THEN_SAVE_STATUS
361363
362364
FROM with-targets AS with-targets-optional
363365
ARG NUMPROC=8
@@ -366,7 +368,7 @@ ARG USE_MAKEFLAGS="-k V=0"
366368
ENV SAGE_CHECK=warn
367369
ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst"
368370
ARG TARGETS_OPTIONAL="ptest"
369-
$RUN $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_OPTIONAL} || echo "(error ignored)" $ENDRUN $THEN_SAVE_STATUS
371+
$RUN$CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_OPTIONAL} || echo "(error ignored)"$ENDRUN$THEN_SAVE_STATUS
370372
371373
#:end:
372374
EOF

.github/sync_labels.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ def actor_valid(self):
609609
for com in coms:
610610
for auth in com['authors']:
611611
login = auth['login']
612-
if not login in authors:
612+
if login not in authors:
613613
if not self.is_this_bot(login) and login != author:
614614
debug('PR %s has recent commit by %s' % (self._issue, login))
615615
authors.append(login)
@@ -746,7 +746,7 @@ def add_label(self, label):
746746
r"""
747747
Add the given label to the issue or PR.
748748
"""
749-
if not label in self.get_labels():
749+
if label not in self.get_labels():
750750
self.edit(label, '--add-label')
751751
info('Add label to %s: %s' % (self._issue, label))
752752

.github/workflows/build.yml

+38-4
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@ jobs:
9797
remove-haskell: true
9898
remove-codeql: true
9999
remove-docker-images: true
100+
100101
- name: Checkout
101102
id: checkout
102103
uses: actions/checkout@v4
104+
103105
- name: Get changed files and packages
104106
id: changed-files
105107
uses: tj-actions/changed-files@v45
@@ -110,26 +112,47 @@ jobs:
110112
- 'build/pkgs/*/spkg-configure.m4'
111113
pkgs:
112114
- 'build/pkgs/**'
115+
- '!build/pkgs/_**'
116+
- '!build/pkgs/configure/**'
113117
- 'pkgs/**'
114118
doctests:
115119
- 'src/**/*.{py,pyx,pxd,pxi,sage,spyx,rst,tex}'
116120
- '!src/{setup,conftest*}.py'
121+
117122
- name: Determine targets to build
118123
id: build-targets
119124
run: |
120-
uninstall_targets=$(echo $(for a in '' ${{ steps.changed-files.outputs.configures_all_changed_files }}; do echo $a | sed -E 's,build/pkgs/([a-z0-9][_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'; done | sort -u))
121-
build_targets=$(echo $(for a in '' ${{ steps.changed-files.outputs.pkgs_all_changed_files }}; do SPKG=$(echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([a-z0-9][-_.a-z0-9]*)/[^ ]* *,\2,;'); if [ -f "build/pkgs/$SPKG/checksums.ini" -o -f "build/pkgs/$SPKG/requirements.txt" -o -f "build/pkgs/$SPKG/spkg-install" ]; then echo "$SPKG-ensure"; fi; done | sort -u))
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+
))
122143
if [ -n "$uninstall_targets" ]; then
123-
echo "build_targets=$uninstall_targets reconfigure $build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT
144+
echo "build_targets=$uninstall_targets reconfigure $build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT
124145
else
125-
echo "build_targets=$build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT
146+
echo "build_targets=$build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT
126147
fi
127148
cat $GITHUB_OUTPUT
149+
128150
- uses: actions/checkout@v4
129151
with:
130152
ref: ${{ github.base_ref }}
131153
path: worktree-base
132154
if: github.base_ref && steps.changed-files.outputs.pkgs_all_changed_files
155+
133156
- name: Compute metrics
134157
run: |
135158
export PATH=build/bin:$PATH
@@ -140,13 +163,15 @@ jobs:
140163
else
141164
sage-package metrics :all:
142165
fi
166+
143167
- name: Install test prerequisites
144168
# From docker.yml
145169
run: |
146170
sudo DEBIAN_FRONTEND=noninteractive apt-get update
147171
sudo DEBIAN_FRONTEND=noninteractive apt-get install tox
148172
sudo apt-get clean
149173
df -h
174+
150175
- name: Merge CI fixes from sagemath/sage
151176
# From docker.yml
152177
# This step needs to happen after the commit sha is put in DOCKER_TAG
@@ -254,16 +279,19 @@ jobs:
254279
remove-haskell: true
255280
remove-codeql: true
256281
remove-docker-images: true
282+
257283
- name: Checkout
258284
id: checkout
259285
uses: actions/checkout@v4
286+
260287
- name: Install test prerequisites
261288
# From docker.yml
262289
run: |
263290
sudo DEBIAN_FRONTEND=noninteractive apt-get update
264291
sudo DEBIAN_FRONTEND=noninteractive apt-get install tox
265292
sudo apt-get clean
266293
df -h
294+
267295
- name: Merge CI fixes from sagemath/sage
268296
# From docker.yml
269297
# This step needs to happen after the commit sha is put in DOCKER_TAG
@@ -352,16 +380,19 @@ jobs:
352380
remove-haskell: true
353381
remove-codeql: true
354382
remove-docker-images: true
383+
355384
- name: Checkout
356385
id: checkout
357386
uses: actions/checkout@v4
387+
358388
- name: Install test prerequisites
359389
# From docker.yml
360390
run: |
361391
sudo DEBIAN_FRONTEND=noninteractive apt-get update
362392
sudo DEBIAN_FRONTEND=noninteractive apt-get install tox
363393
sudo apt-get clean
364394
df -h
395+
365396
- name: Merge CI fixes from sagemath/sage
366397
# From docker.yml
367398
# This step needs to happen after the commit sha is put in DOCKER_TAG
@@ -469,16 +500,19 @@ jobs:
469500
remove-haskell: true
470501
remove-codeql: true
471502
remove-docker-images: true
503+
472504
- name: Checkout
473505
id: checkout
474506
uses: actions/checkout@v4
507+
475508
- name: Install test prerequisites
476509
# From docker.yml
477510
run: |
478511
sudo DEBIAN_FRONTEND=noninteractive apt-get update
479512
sudo DEBIAN_FRONTEND=noninteractive apt-get install tox
480513
sudo apt-get clean
481514
df -h
515+
482516
- name: Merge CI fixes from sagemath/sage
483517
# From docker.yml
484518
# This step needs to happen after the commit sha is put in DOCKER_TAG

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.5.beta6
7+
version: 10.5.beta7
88
doi: 10.5281/zenodo.8042260
9-
date-released: 2024-09-29
9+
date-released: 2024-10-12
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.5.beta6, Release Date: 2024-09-29
1+
SageMath version 10.5.beta7, Release Date: 2024-10-12

build/pkgs/configure/checksums.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=140d921780212198287a0d626b8c9655d4408f7a
3-
sha256=4f82ec8bdb67c4dffd43daddd5160e8f9c624f6a5cf16c4128bfab2e5ddca459
2+
sha1=978eb775a20fea3ed9b88f0d67ecd84a3d9cd6ea
3+
sha256=c3987bb0f8aca81e112a17d8904ef2353a706159d43250305dc2bcac4ca2e33a
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2b4fe39e420df022d34a67fbc820252618e15f83
1+
4326d0d9422011034a230ab3c1445fafeb2ac444

build/pkgs/pari/spkg-configure.m4

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
SAGE_SPKG_CONFIGURE([pari], [
22
dnl See gp_version below on how the version is computed from MAJV.MINV.PATCHV
33
m4_pushdef([SAGE_PARI_MINVER],["134916"])dnl this version and higher allowed
4-
m4_pushdef([SAGE_PARI_MAXVER],["999999"])dnl this version and higher not allowed
4+
dnl Do not allow Pari 2.17 or later, see #38769:
5+
m4_pushdef([SAGE_PARI_MAXVER],["135424"])dnl this version and higher not allowed
56
SAGE_SPKG_DEPCHECK([gmp readline], [
67
AC_PATH_PROG([GP], [gp])
78
if test x$GP = x; then dnl GP test

build/pkgs/r/spkg-configure.m4

-14
This file was deleted.

build/pkgs/r_jupyter/dependencies

+5-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
notebook r
1+
notebook rpy2
2+
3+
----------
4+
R is the real dependency. But SPKG r is a dummy package, and does not install R.
5+
Since SPKG rpy2 checks for the system R, we put rpy2 as a dependency instead.

build/pkgs/rpy2/dependencies

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
r cffi tzlocal pytz jinja2 | $(PYTHON_TOOLCHAIN) pycparser $(PYTHON)
1+
cffi tzlocal pytz jinja2 | $(PYTHON_TOOLCHAIN) pycparser $(PYTHON)
22

33
----------
44
All lines of this file are ignored except the first.

0 commit comments

Comments
 (0)