Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into 36951
Browse files Browse the repository at this point in the history
  • Loading branch information
saraedum committed Apr 28, 2024
2 parents 30e012f + c4363fc commit 26a234d
Show file tree
Hide file tree
Showing 302 changed files with 9,411 additions and 4,856 deletions.
2 changes: 0 additions & 2 deletions .devcontainer/onCreate-conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ conda init bash

# Build sage
conda run -n sage-dev ./bootstrap
conda run -n sage-dev ./configure --with-python=/opt/conda/envs/sage-dev/bin/python --prefix=/opt/conda/envs/sage-dev
conda run -n sage-dev pip install --no-build-isolation -v -v -e ./pkgs/sage-conf ./pkgs/sage-setup
conda run -n sage-dev pip install --no-build-isolation -v -v -e ./src
9 changes: 2 additions & 7 deletions .github/workflows/ci-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
SAGE_CI_FIXES_FROM_REPOSITORIES: ${{ vars.SAGE_CI_FIXES_FROM_REPOSITORIES }}

- name: Cache conda packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/conda_pkgs_dir
key:
Expand All @@ -77,21 +77,16 @@ jobs:
conda info
conda list
- name: Configure
- name: Bootstrap
shell: bash -l {0}
continue-on-error: true
run: |
./bootstrap
echo "::add-matcher::.github/workflows/configure-systempackage-problem-matcher.json"
./configure --enable-build-as-root --with-python=$CONDA_PREFIX/bin/python --prefix=$CONDA_PREFIX --enable-system-site-packages $(for pkg in $(./sage -package list :standard: --has-file spkg-configure.m4 --has-file distros/conda.txt --exclude rpy2); do echo --with-system-$pkg=force; done)
echo "::remove-matcher owner=configure-system-package-warning::"
echo "::remove-matcher owner=configure-system-package-error::"
- name: Build
shell: bash -l {0}
run: |
# Use --no-deps and pip check below to verify that all necessary dependencies are installed via conda.
pip install --no-build-isolation --no-deps -v -v -e ./pkgs/sage-conf ./pkgs/sage-setup
pip install --no-build-isolation --no-deps --config-settings editable_mode=compat -v -v -e ./src
env:
SAGE_NUM_THREADS: 2
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ jobs:
- os: ubuntu-latest
arch: i686
- os: macos-latest
arch: auto
arch: x86_64
- os: macos-14
arch: arm64
env:
# SPKGs to install as system packages
SPKGS: _bootstrap _prereq
Expand All @@ -141,6 +143,14 @@ jobs:
name: dist
path: dist

- uses: actions/setup-python@v5
# As of 2024-02-03, the macOS M1 runners do not have preinstalled python or pipx.
# Installing pipx follows the approach of https://github.com/pypa/cibuildwheel/pull/1743
id: python
with:
python-version: "3.8 - 3.12"
update-environment: false

- 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,
Expand All @@ -151,12 +161,13 @@ jobs:
# This is unfortunately repeated for each of the packages that we build wheels for
# because CIBW starts with a fresh container on each invocation.
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"
mkdir -p unpacked
for pkg in sagemath-objects sagemath-categories; do
(cd unpacked && tar xfz - ) < dist/$pkg*.tar.gz
pipx run cibuildwheel==2.16.2 unpacked/$pkg*
"${{ steps.python.outputs.python-path }}" -m pipx run cibuildwheel==2.17.0 unpacked/$pkg*
done
- uses: actions/upload-artifact@v3
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This action automatically labels Pull-Requests
# based on files edited and no of lines changed.
name: Size Labeler/Checker
on:
pull_request_target:
types:
- opened
- reopened
- synchronize
- ready_for_review
- review_requested
- edited
jobs:
label-changes:
if: vars.SMALL_THRESHOLD && vars.MODERATE_THRESHOLD && vars.LARGE_THRESHOLD && github.event.pull_request.draft == false
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Add labels based on size
run: |
git fetch origin $BASE_SHA
chmod a+x .github/workflows/set_labels_by_changes.sh
.github/workflows/set_labels_by_changes.sh
env:
BASE_SHA: ${{ github.base_ref }}
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number}}
SMALL_THRESHOLD: ${{ vars.SMALL_THRESHOLD }}
MODERATE_THRESHOLD: ${{ vars.MODERATE_THRESHOLD }}
LARGE_THRESHOLD: ${{ vars.LARGE_THRESHOLD }}
67 changes: 67 additions & 0 deletions .github/workflows/set_labels_by_changes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/env bash

echo 'set_labels_by_changes.sh called with environment:'
echo "BASE SHA: $PR_BASE_SHA"
echo "HEAD SHA: $PR_HEAD_SHA"
echo "SMALL THRESHOLD $SMALL_THRESHOLD"
echo "MODERATE THERESHOLD: $MODERATE_THRESHOLD"
echo "LARGE THRESHOLD: $LARGE_THRESHOLD"

# get all the changes made and changed files
CHANGES=$(git diff --ignore-all-space $PR_BASE_SHA $PR_HEAD_SHA)

# ignore blank lines
CHANGES=$(echo "$CHANGES" | grep -vE '^[\+\-]\s*$')

# ignore non necessary lines from git diff
CHANGES=$(echo "$CHANGES" | grep -E '^[+\-]' | grep -vE '^\+\+\+|^\-\-\-')

# count total no of lines
CHANGES=$(echo "$CHANGES" | wc -l)

echo "CHANGES MADE: $CHANGES"

AUTH_HEADER="Authorization: Bearer $GITHUB_TOKEN"

MINIMAL="v: minimal"
SMALL="v: small"
MODERATE="v: moderate"
LARGE="v: large"

DELETE_LABELS=("$MINIMAL" "$SMALL" "$MODERATE" "$LARGE")

if [ "$CHANGES" -gt "$LARGE_THRESHOLD" ]; then
SIZE_LABEL="$LARGE"
elif [ "$CHANGES" -gt "$MODERATE_THRESHOLD" ]; then
SIZE_LABEL="$MODERATE"
elif [ "$CHANGES" -gt "$SMALL_THRESHOLD" ]; then
SIZE_LABEL="$SMALL"
else
SIZE_LABEL="$MINIMAL"
fi

DELETE_LABELS=("${DELETE_LABELS[@]//${SIZE_LABEL}/}")

# API for adding labels on the Pull Request
API_URL="https://api.github.com/repos/$REPOSITORY/issues/$PR_NUMBER/labels"

echo "Adding label: ${SIZE_LABEL[@]}"
for LABEL in "${SIZE_LABEL[@]}"; do
curl -X POST \
-H "$AUTH_HEADER" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-d "{\"labels\":[\"$LABEL\"]}" \
"$API_URL" >/dev/null
done

echo "Deleting Labels:"

for DELETE_LABEL in "${DELETE_LABELS[@]}"; do
ENCODED_LABEL=$(echo "$DELETE_LABEL" | sed 's/ /%20/g')
curl -X DELETE \
-H "Accept: application/vnd.github+json" \
-H "$AUTH_HEADER" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"$API_URL/$ENCODED_LABEL" >/dev/null
done
2 changes: 0 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ tasks:
&& conda config --append envs_dirs $(pwd)
&& conda activate $(pwd)/venv
&& ./bootstrap
&& ./configure --enable-build-as-root --with-python=$CONDA_PREFIX/bin/python --prefix=$CONDA_PREFIX
&& pip install --no-build-isolation -v -v -e ./pkgs/sage-conf ./pkgs/sage-setup
&& pip install --no-build-isolation -v -v -e ./src
# Activate conda environment, set up Trac remote
# RestructuredText extension recommends python extension, although we have already installed it
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.beta3
version: 10.4.beta4
doi: 10.5281/zenodo.593563
date-released: 2024-04-12
date-released: 2024-04-27
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.beta3, Release Date: 2024-04-12
SageMath version 10.4.beta4, Release Date: 2024-04-27
4 changes: 2 additions & 2 deletions build/bin/sage-logger
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ fi

timefile="$logdir/$logname.time"
rm -f "$timefile"
if /usr/bin/time -h -o /dev/null true; then
if /usr/bin/time -h -o /dev/null true 2>/dev/null; then
TIME="/usr/bin/time -h -o $timefile"
else
TIME=""
fi

report_time ()
{
time=$(echo $(cat $timefile))
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
Expand Down
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=b9d9a4bb2d949d8f6fffe63c77ff069d59ca6e8c
md5=95f8a1d22f684e3f61019ae82111e639
cksum=3352815196
sha1=2d6779beb2e69f0f7bddc2edc44ad275442ffd29
md5=789344e03a6b57ba1538c0c760449720
cksum=3806733369
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4dd66116b58babf05bb8e4b30282638e2c0b82c3
0a7b2513287af1124a358c2494b8bef4668a1882
2 changes: 1 addition & 1 deletion build/pkgs/gdb/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mpfr zlib ncurses xz | $(PYTHON)
mpfr zlib ncurses | $(PYTHON) xz

----------
All lines of this file are ignored except the first.
2 changes: 1 addition & 1 deletion build/pkgs/gmp/dependencies
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
xz
| xz

# xz is only needed to unpack the tarball when sage-bootstrap-python is Python < 3.3
2 changes: 1 addition & 1 deletion build/pkgs/libgd/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
libpng xz
libpng | xz

# xz needed to unpack tarball when sage-bootstrap-python is Python < 3.3
----------
Expand Down
6 changes: 3 additions & 3 deletions build/pkgs/onetbb/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=onetbb-VERSION.tar.gz
sha1=b991f5d882aba2182871cfe011614cc43b92aa3c
md5=ba4ecedc4949f673a34b35de738a72fc
cksum=211900655
sha1=740e86b703f42446ddde392b73a9db3dc0f5f4cd
md5=b301151120b08a17e98dcdda6e4f6011
cksum=3287903962
upstream_url=https://github.com/oneapi-src/oneTBB/archive/refs/tags/vVERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/onetbb/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.9.0
2021.11.0

This file was deleted.

6 changes: 3 additions & 3 deletions build/pkgs/papilo/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=papilo-VERSION.tar.gz
sha1=85d599ac9936aa1ddf687e04273b995522909de5
md5=c41f5aa615ffc9914f8ca924947aa8cb
cksum=1535425476
sha1=069f64ff25cfb08c9b2a416d1d215bd5b907c877
md5=d58b7c991ac1c4a863de92a404409ca8
cksum=1552180280
upstream_url=https://github.com/scipopt/papilo/archive/refs/tags/vVERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/papilo/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.1
2.2.0

This file was deleted.

20 changes: 0 additions & 20 deletions build/pkgs/papilo/patches/import_memory_multiprecision.patch

This file was deleted.

16 changes: 16 additions & 0 deletions build/pkgs/pyproject_hooks/SPKG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pyproject_hooks: Wrappers to call pyproject.toml-based build backend hooks.
===========================================================================

Description
-----------

Wrappers to call pyproject.toml-based build backend hooks.

License
-------

Upstream Contact
----------------

https://pypi.org/project/pyproject_hooks/

5 changes: 5 additions & 0 deletions build/pkgs/pyproject_hooks/checksums.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tarball=pyproject_hooks-VERSION-py3-none-any.whl
sha1=6c99163c52786fb97eac8b4e38cc13fa3af141a9
md5=68020c2619c7a744dcee12b670c9f413
cksum=3405759428
upstream_url=https://pypi.io/packages/py3/p/pyproject_hooks/pyproject_hooks-VERSION-py3-none-any.whl
4 changes: 4 additions & 0 deletions build/pkgs/pyproject_hooks/dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
| $(PYTHON_TOOLCHAIN) $(PYTHON)

----------
All lines of this file are ignored except the first.
1 change: 1 addition & 0 deletions build/pkgs/pyproject_hooks/package-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.0
1 change: 1 addition & 0 deletions build/pkgs/pyproject_hooks/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
standard
1 change: 1 addition & 0 deletions build/pkgs/pyproject_hooks/version_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pyproject_hooks
Loading

0 comments on commit 26a234d

Please sign in to comment.