Skip to content

Commit

Permalink
Merge branch '36676' into 36964
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed May 25, 2024
2 parents a436233 + 0a27566 commit 903cb92
Show file tree
Hide file tree
Showing 787 changed files with 9,314 additions and 11,249 deletions.
2 changes: 1 addition & 1 deletion .ci/create-changes-html.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ for block in diff_blocks:
if content:
with open(file_path, 'w') as file:
file.writelines(content)
path = 'html/' + doc
path = doc
hunks = '&nbsp;'.join(f'<a href="{path}#hunk{i+1}" class="hunk" target="_blank">#{i + 1}</a>' for i in range(count))
out_blocks.append(f'<p class="diff"><a href="{path}">{doc}</a>&nbsp;' + hunks + '&emsp;</p>'
+ '\n<pre><code class="language-diff">'
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

29 changes: 21 additions & 8 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ jobs:
arch: x86_64
- os: ubuntu-latest
arch: i686
- os: macos-latest
- os: macos-13
arch: x86_64
- os: macos-14
arch: arm64
Expand All @@ -175,16 +175,16 @@ jobs:
# SPKGs to install as system packages
SPKGS: _bootstrap _prereq
# Non-Python packages to install as spkgs
TARGETS_PRE: gmpy2-build-deps
TARGETS_PRE: gmp mpfr mpc bliss coxeter3 mcqd meataxe sirocco boost_cropped tdlib
# Disable building PyPy wheels on all platforms
# Disable musllinux until #33083 provides alpine package information
CIBW_SKIP: "pp* *-musllinux*"
#
CIBW_ARCHS: ${{ matrix.arch }}
# https://cibuildwheel.readthedocs.io/en/stable/options/#requires-python
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9, <3.12"
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9, <3.13"
# Environment during wheel build
CIBW_ENVIRONMENT: "PATH=$(pwd)/local/bin:$PATH CPATH=$(pwd)/local/include:$CPATH LIBRARY_PATH=$(pwd)/local/lib:$LIBRARY_PATH PKG_CONFIG_PATH=$(pwd)/local/share/pkgconfig:$PKG_CONFIG_PATH ACLOCAL_PATH=/usr/share/aclocal"
CIBW_ENVIRONMENT: "PATH=$(pwd)/prefix/bin:$PATH CPATH=$(pwd)/prefix/include:$CPATH LIBRARY_PATH=$(pwd)/prefix/lib:$LIBRARY_PATH LD_LIBRARY_PATH=$(pwd)/prefix/lib:$LD_LIBRARY_PATH PKG_CONFIG_PATH=$(pwd)/prefix/share/pkgconfig:$PKG_CONFIG_PATH ACLOCAL_PATH=/usr/share/aclocal PIP_CONSTRAINT=$(pwd)/constraints.txt"
# Use 'build', not 'pip wheel'
CIBW_BUILD_FRONTEND: build
steps:
Expand All @@ -203,23 +203,36 @@ jobs:
python-version: "3.8 - 3.12"
update-environment: false

- name: Bootstrap
run: |
export PATH=$(pwd)/build/bin:$PATH
eval $(sage-print-system-package-command auto --sudo --yes --no-install-recommends --spkg install _bootstrap)
./bootstrap
- name: Build platform wheels
# We build the wheels from the sdists so that MANIFEST filtering becomes effective.
# But we must run cibuildwheel with the unpacked source directory, not a tarball,
# so that SAGE_ROOT is copied into the build containers.
#
# In the CIBW_BEFORE_ALL phase, we install libraries using the Sage distribution.
# https://cibuildwheel.readthedocs.io/en/stable/options/#before-all
# This is unfortunately repeated for each of the packages that we build wheels for
# For Linux, this is repeated for each of the packages that we build wheels for
# because CIBW starts with a fresh container on each invocation.
# Therefore we cache it in a directory mounted from the host: /host
# https://cibuildwheel.pypa.io/en/stable/faq/#linux-builds-in-containers
#
# omit sagemath-{meataxe,sirocco} for now -- needs sagemath-modules
run: |
"${{ steps.python.outputs.python-path }}" -m pip install pipx
export PATH=build/bin:$PATH
export CIBW_BEFORE_ALL="( $(sage-print-system-package-command debian --yes --no-install-recommends install $(sage-get-system-packages debian $SPKGS)) || $(sage-print-system-package-command fedora --yes --no-install-recommends install $(sage-get-system-packages fedora $SPKGS | sed s/pkg-config/pkgconfig/)) || ( $(sage-print-system-package-command homebrew --yes --no-install-recommends install $(sage-get-system-packages homebrew $SPKGS)) || echo error ignored) ) && ./bootstrap && ./configure --enable-build-as-root && make -j4 V=0 $TARGETS_PRE"
export CIBW_BEFORE_ALL="( $(sage-print-system-package-command debian --yes --no-install-recommends install $(sage-get-system-packages debian $SPKGS)) || $(sage-print-system-package-command fedora --yes --no-install-recommends install $(sage-get-system-packages fedora $SPKGS | sed s/pkg-config/pkgconfig/)) || ( $(sage-print-system-package-command homebrew --yes --no-install-recommends install $(sage-get-system-packages homebrew $SPKGS)) || echo error ignored) ) && if cp /host/sage-\$AUDITWHEEL_PLAT/config.status . 2>/dev/null; then chmod +x config.status; fi && if [ -x ./config.status ]; then ./config.status; else ./configure --enable-build-as-root ${{ startsWith(matrix.os, 'ubuntu') && '--prefix=/host/sage-\$AUDITWHEEL_PLAT' || '' }} && cp config.status prefix/; fi && MAKE=\"make -j6\" make V=0 $TARGETS_PRE && (echo \"sage_conf @ file://\$(pwd)/pkgs/sage-conf\" && echo \"sage_setup @ file://\$(pwd)/pkgs/sage-setup\") > constraints.txt"
mkdir -p unpacked
for pkg in sagemath-objects sagemath-categories; do
for pkg in sagemath*objects sagemath*categories sagemath*bliss sagemath*coxeter3 sagemath*mcqd sagemath*tdlib; do
case "$pkg:${{ matrix.arch }}" in
sagemath*tdlib:i686) continue;; # broken - boost-related
esac
(cd unpacked && tar xfz - ) < dist/$pkg*.tar.gz
"${{ steps.python.outputs.python-path }}" -m pipx run cibuildwheel==2.17.0 unpacked/$pkg*
"${{ steps.python.outputs.python-path }}" -m pipx run cibuildwheel==2.18.0 unpacked/$pkg*
done
- uses: actions/upload-artifact@v4
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ on:
"ubuntu-lunar",
"ubuntu-mantic",
"ubuntu-noble",
"debian-buster-gcc_spkg",
"debian-bullseye",
"debian-bookworm",
"debian-trixie",
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/docker_hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
default: make-build
type: string

env:
CAN_LOGIN: ${{ secrets.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '' }}

jobs:
build-and-push:
name: Build Docker image and push to DockerHub
Expand Down Expand Up @@ -71,11 +74,12 @@ jobs:
if: env.JOB_DONE == 'false'

- name: Login to Docker Hub
id: login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
if: env.JOB_DONE == 'false'
if: env.JOB_DONE == 'false' && env.CAN_LOGIN == 'true'

- name: Build and push make-build
uses: docker/build-push-action@v5
Expand All @@ -85,8 +89,9 @@ jobs:
target: ${{ inputs.dockerfile_target }}
build-args: |
MAKE_BUILD=${{ env.BASE }}
push: true
push: ${{ steps.login.outcome == 'success' }}
tags: ${{ env.TAG_LIST }}
cache-from: type=gha
cache-to: type=gha,mode=max
if: env.JOB_DONE == 'false'
# run even if there are no push credentials (just don't push)
if: (success() || failure()) && env.JOB_DONE == 'false'
9 changes: 8 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ jobs:
id: deps
run: pip install tox

- name: Code style check with pycodestyle
- name: Code style check with ruff-minimal
if: (success() || failure()) && steps.deps.outcome == 'success'
run: tox -e ruff-minimal
env:
# https://github.com/ChartBoost/ruff-action/issues/7#issuecomment-1887780308
RUFF_OUTPUT_FORMAT: github

- name: Code style check with pycodestyle-minimal
if: (success() || failure()) && steps.deps.outcome == 'success'
run: tox -e pycodestyle-minimal

Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ title: SageMath
abstract: SageMath is a free open-source mathematics software system.
authors:
- name: "The SageMath Developers"
version: 10.4.beta6
version: 10.4.beta7
doi: 10.5281/zenodo.8042260
date-released: 2024-05-12
date-released: 2024-05-25
repository-code: "https://github.com/sagemath/sage"
url: "https://www.sagemath.org/"
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SageMath version 10.4.beta6, Release Date: 2024-05-12
SageMath version 10.4.beta7, Release Date: 2024-05-25
29 changes: 12 additions & 17 deletions build/bin/sage-logger
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,19 @@ fi

timefile="$logdir/$logname.time"
rm -f "$timefile"
if /usr/bin/time -h -o /dev/null true 2>/dev/null; then
TIME="/usr/bin/time -h -o $timefile"
else
TIME=""
fi
time_cmd() {
local max=$(($SECONDS+10))
exec 3>&1 4>&2
local out
TIME_OUTPUT=$((time 1>&3 2>&4 sh -c "$1") 2>&1)
local retstat=$?
[ "$SECONDS" -lt "$max" ] || echo "$TIME_OUTPUT" > "$timefile"
return $retstat
}
report_time ()
{
time=$(echo $(cat $timefile 2>/dev/null))
case "$time" in
*m*real*|*h*real*|*[1-9][0-9].*real*|*[1-9][0-9],*real*)
# at least 10 seconds wall time
echo "$time"
;;
esac
[ -r "$timefile" ] && echo $(< $timefile)
}
mkdir -p "$logdir"
Expand All @@ -94,8 +92,7 @@ if [ -n "$SAGE_SILENT_BUILD" -a ${use_prefix} = true ]; then
# Silent build.
# Similar to https://www.gnu.org/software/automake/manual/html_node/Automake-Silent-Rules.html#Automake-Silent-Rules
echo "[$logname] installing. Log file: $logfile"
( exec>> $logfile 2>&1 ; $TIME sh -c "$cmd"; status=$?;
[ -r $timefile ] && cat $timefile; exit $status )
( exec>> $logfile 2>&1; time_cmd "$cmd"; status=$?; report_time; exit $status )
status=$?
if [[ $status != 0 ]]; then
echo " [$logname] error installing, exit status $status. End of log file:"
Expand All @@ -115,9 +112,7 @@ else
# We trap SIGINT such that SIGINT interrupts the main process being
# run, not the logging.
( exec 2>&1;
$TIME sh -c "$cmd"; status=$?; report_time;
exit $status ) | \
( exec 2>&1; time_cmd "$cmd"; status=$?; report_time; exit $status ) | \
( trap '' SIGINT; if [ -n "$GITHUB_ACTIONS" -a -n "$prefix" ]; then echo "::group::${logname}"; fi; tee -a "$logfile" | $SED; if [ -n "$GITHUB_ACTIONS" -a -n "$prefix" ]; then echo "::endgroup::"; fi )
pipestatus=(${PIPESTATUS[*]})
Expand Down
30 changes: 4 additions & 26 deletions build/bin/sage-spkg
Original file line number Diff line number Diff line change
Expand Up @@ -363,32 +363,10 @@ WRAPPED_SCRIPTS="build install preinst pipinst postinst $INSTALLED_SCRIPTS"
warning_for_experimental_packages() { ############################
if [ x`cat "$PKG_SCRIPTS/type"` = x"experimental" ]; then
if [ $YES != 1 -a -n "$PKG_NAME_UPSTREAM" ]; then
# We use /dev/tty here because our output may be redirected
# to a logfile, or line-buffered.
write_to_tty <<EOF
=========================== WARNING ===========================
You are about to download and install the experimental package
$PKG_NAME. This probably won't work at all for you! There
is no guarantee that it will build correctly, or behave as
expected. Use at your own risk!
===============================================================
EOF
if [ $? -ne 0 ]; then
echo "Terminal not available for prompting. Use 'sage -i -y $PKG_BASE'"
echo "to install experimental packages in non-interactive mode."
YES=-1
fi
if [ $YES != -1 ]; then
read -p "Are you sure you want to continue [Y/n]? " answer < /dev/tty > /dev/tty 2>&1
else
answer=n
fi
case "$answer" in
n*|N*) exit 1;;
esac
# Confirm the user's input. (This gives important
# feedback to the user when output is redirected to a logfile.)
echo > /dev/tty "OK, installing $PKG_NAME now..."
echo "Error: The package $PKG_NAME is marked as experimental."
echo "Use 'sage -i -y $PKG_BASE' to force installation of this package"
echo "or use the configure option --enable-experimental-packages"
exit 1
fi
fi
} ############################## warning_for_experimental_packages
Expand Down
2 changes: 2 additions & 0 deletions build/make/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# Always use bash for make rules
SHELL = @SHELL@

ifndef DEBUG_RULES
# Check a variable that is only set in build/make/install, but not in sage-env, for example
ifndef SAGE_PKGCONFIG
# Set by build/bin/sage-sdist, which invokes the Makefile directly in
Expand All @@ -25,6 +26,7 @@ ifndef SAGE_SPKG_COPY_UPSTREAM
$(error This Makefile needs to be invoked by build/make/install)
endif
endif
endif

# Directory to keep track of which packages are installed - relative to installation prefix
SPKG_INST_RELDIR = var/lib/sage/installed
Expand Down
3 changes: 1 addition & 2 deletions build/pkgs/4ti2/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
tarball=4ti2-${VERSION}.tar.gz
sha1=3d41f30ea3ef94c293eae30c087494269fc1a6b9
md5=1215872325ddfc561865ecb22b2bccb2
cksum=2439180289
sha256=f7c191beb14246b643e4fd5b18b53d9966693b9e6d3a569441a0e3ca14b1a86b
upstream_url=https://github.com/4ti2/4ti2/releases/download/Release_${VERSION_MAJOR}_${VERSION_MINOR}_${VERSION_MICRO}/4ti2-${VERSION}.tar.gz
3 changes: 1 addition & 2 deletions build/pkgs/alabaster/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
tarball=alabaster-VERSION-py3-none-any.whl
sha1=6c86446396c69236a1542e09771e8d7b8487dcfa
md5=a1c5ddb246633ac0567beef4a1dcffd7
cksum=2188566230
sha256=b46733c07dce03ae4e150330b975c75737fa60f0a7c591b6c8bf4928a28e2c92
upstream_url=https://pypi.io/packages/py3/a/alabaster/alabaster-VERSION-py3-none-any.whl
3 changes: 1 addition & 2 deletions build/pkgs/anyio/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
tarball=anyio-VERSION-py3-none-any.whl
sha1=bb08368bb19e1aff2f4190e39300e43fee52103e
md5=420d85e19168705cdf0223621b18831a
cksum=627181302
sha256=cfdb2b588b9fc25ede96d8db56ed50848b0b649dca3dd1df0b11f683bb9e0b5f
upstream_url=https://pypi.io/packages/py3/a/anyio/anyio-VERSION-py3-none-any.whl
3 changes: 1 addition & 2 deletions build/pkgs/appdirs/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
tarball=appdirs-VERSION-py2.py3-none-any.whl
sha1=fc74022712122436427f8282a47bfa430ec2db56
md5=1d638a5913a8d8ed8e7c7d789ece149c
cksum=3594208532
sha256=a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128
upstream_url=https://pypi.io/packages/py2.py3/a/appdirs/appdirs-VERSION-py2.py3-none-any.whl
3 changes: 1 addition & 2 deletions build/pkgs/appnope/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
tarball=appnope-VERSION.tar.gz
sha1=dd705054af5f6c80d0ce9e1b444428c7b1b07daa
md5=ca8ec0b1628061ce922dbf1ceee25bca
cksum=3863274580
sha256=02bd91c4de869fbb1e1c50aafc4098827a7a54ab2f39d9dcba6c9547ed920e24
upstream_url=https://pypi.io/packages/source/a/appnope/appnope-VERSION.tar.gz
3 changes: 1 addition & 2 deletions build/pkgs/argon2_cffi/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
tarball=argon2-cffi-VERSION.tar.gz
sha1=c16c1506de0211bdfa23d4d51e780fb4aaff5222
md5=b7843e8690c790f8e743d37bb75c25a8
cksum=3700408796
sha256=d384164d944190a7dd7ef22c6aa3ff197da12962bd04b17f64d4e93d934dba5b
upstream_url=https://pypi.io/packages/source/a/argon2_cffi/argon2-cffi-VERSION.tar.gz
3 changes: 1 addition & 2 deletions build/pkgs/argon2_cffi_bindings/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
tarball=argon2-cffi-bindings-VERSION.tar.gz
sha1=5a9b8906d9ca73c53c2bf0a2f0a8127fda69e965
md5=f1591e1af7dea9ef3e5b982e2c196c1d
cksum=2420586823
sha256=bb89ceffa6c791807d1305ceb77dbfacc5aa499891d2c55661c6459651fc39e3
upstream_url=https://pypi.io/packages/source/a/argon2_cffi_bindings/argon2-cffi-bindings-VERSION.tar.gz
3 changes: 1 addition & 2 deletions build/pkgs/arrow/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
tarball=arrow-VERSION-py3-none-any.whl
sha1=fd9376ef4788dc2b1c981e6b5beb9048e046c556
md5=71d18bb3d882ae242b5b1a397313bb12
cksum=244356435
sha256=c728b120ebc00eb84e01882a6f5e7927a53960aa990ce7dd2b10f39005a67f80
upstream_url=https://pypi.io/packages/py3/a/arrow/arrow-VERSION-py3-none-any.whl
3 changes: 1 addition & 2 deletions build/pkgs/asttokens/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
tarball=asttokens-VERSION.tar.gz
sha1=d522a139240293953c99d32ca62c41542babb963
md5=c353679585a40f43c24ca60fca33bbf6
cksum=1117135252
sha256=b03869718ba9a6eb027e134bfdf69f38a236d681c83c160d510768af11254ba0
upstream_url=https://pypi.io/packages/source/a/asttokens/asttokens-VERSION.tar.gz
3 changes: 1 addition & 2 deletions build/pkgs/async_lru/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
tarball=async_lru-VERSION-py3-none-any.whl
sha1=99b2ea5d551cbad28e08e45f0d0b00827f9ff73d
md5=de1e9e7559810690de8b7084b372d9a2
cksum=3326301475
sha256=ff02944ce3c288c5be660c42dbcca0742b32c3b279d6dceda655190240b99224
upstream_url=https://pypi.io/packages/py3/a/async_lru/async_lru-VERSION-py3-none-any.whl
3 changes: 1 addition & 2 deletions build/pkgs/attrs/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
tarball=attrs-VERSION-py3-none-any.whl
sha1=d916b1ecad441ce7f07d86034085475f6c231830
md5=5aecf1f8857233a04c1926ea68e8f860
cksum=1934687514
sha256=1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04
upstream_url=https://pypi.io/packages/py3/a/attrs/attrs-VERSION-py3-none-any.whl
3 changes: 1 addition & 2 deletions build/pkgs/awali/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
tarball=awali-all-vVERSION.tgz
sha1=9098aaefde031df58374bab0c1fc38109eecd4e3
md5=d4216d8cbe21f83ae3a816a2f994f85e
cksum=3149228485
sha256=85a2de222f93554d2959e16f64d8e7549b25446dcb0564ed1cb57196fc35f108
Loading

0 comments on commit 903cb92

Please sign in to comment.