Skip to content

Commit e3397a7

Browse files
authored
Merge branch 'develop' into combinat/signed_perm_cycles
2 parents 1b8d03b + 4103129 commit e3397a7

File tree

1,143 files changed

+14699
-12350
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,143 files changed

+14699
-12350
lines changed

.github/workflows/ci-conda.yml

+16-6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
- 'public/build/**-runci'
99
pull_request:
1010
types:
11+
# Defaults
12+
- opened
13+
- synchronize
14+
- reopened
15+
# When a CI label is added
1116
- labeled
1217
workflow_dispatch:
1318
# Allow to run manually
@@ -21,13 +26,18 @@ jobs:
2126
test:
2227
name: Conda
2328
runs-on: ${{ matrix.os }}
24-
25-
# Run on push, workflow dispatch and when certain labels are added
29+
30+
# Run on push, workflow dispatch and when certain labels are added or are present
2631
if: |
27-
github.event.action != 'labeled' ||
28-
github.event.label.name == 'c: packages: optional' ||
29-
github.event.label.name == 'c: packages: standard' ||
30-
github.event.label.name == 's: run conda ci'
32+
github.event_name != 'pull_request' ||
33+
((github.event.action != 'labeled' &&
34+
(contains(github.event.pull_request.labels.*.name, 'c: packages: standard') ||
35+
contains(github.event.pull_request.labels.*.name, 'c: packages: optional') ||
36+
contains(github.event.pull_request.labels.*.name, 's: run conda ci'))) ||
37+
(github.event.action == 'labeled' &&
38+
(github.event.label.name == 'c: packages: optional' ||
39+
github.event.label.name == 'c: packages: standard' ||
40+
github.event.label.name == 's: run conda ci')))
3141
3242
strategy:
3343
fail-fast: false
+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: CI Linux incremental
2+
3+
## This GitHub Actions workflow runs SAGE_ROOT/tox.ini with select environments,
4+
## whenever a GitHub pull request is opened or synchronized in a repository
5+
## where GitHub Actions are enabled.
6+
##
7+
## It builds and checks some sage spkgs as defined in TARGETS.
8+
##
9+
## A job succeeds if there is no error.
10+
##
11+
## The build is run with "make V=0", so the build logs of individual packages are suppressed.
12+
##
13+
## At the end, all package build logs that contain an error are printed out.
14+
##
15+
## After all jobs have finished (or are canceled) and a short delay,
16+
## tar files of all logs are made available as "build artifacts".
17+
18+
on:
19+
pull_request:
20+
types:
21+
# Defaults
22+
- opened
23+
- synchronize
24+
- reopened
25+
# When a CI label is added
26+
- labeled
27+
workflow_dispatch:
28+
29+
concurrency:
30+
# Cancel previous runs of this workflow for the same branch
31+
group: ${{ github.workflow }}-${{ github.ref }}
32+
cancel-in-progress: true
33+
34+
permissions:
35+
packages: write
36+
37+
jobs:
38+
39+
changed_files:
40+
runs-on: ubuntu-latest
41+
name: List changed packages
42+
outputs:
43+
uninstall_targets: ${{ steps.build-targets.outputs.uninstall_targets }}
44+
build_targets: ${{ steps.build-targets.outputs.build_targets }}
45+
steps:
46+
- uses: actions/checkout@v3
47+
- name: Get all packages that have changed
48+
id: changed-packages
49+
uses: tj-actions/changed-files@v38
50+
with:
51+
files_yaml: |
52+
configures:
53+
- 'build/pkgs/*/spkg-configure.m4'
54+
pkgs:
55+
- 'build/pkgs/**'
56+
- 'pkgs/**'
57+
- name: Determine targets to build
58+
id: build-targets
59+
run: |
60+
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
61+
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
62+
cat $GITHUB_OUTPUT
63+
minimal:
64+
needs: [changed_files]
65+
if: |
66+
github.event_name != 'pull_request' ||
67+
((github.event.action != 'labeled' &&
68+
(contains(github.event.pull_request.labels.*.name, 'c: packages: standard') ||
69+
contains(github.event.pull_request.labels.*.name, 'c: packages: optional'))) ||
70+
(github.event.action == 'labeled' &&
71+
(github.event.label.name == 'c: packages: optional' ||
72+
github.event.label.name == 'c: packages: standard')))
73+
uses: ./.github/workflows/docker.yml
74+
with:
75+
# Build incrementally from published Docker image
76+
incremental: true
77+
free_disk_space: true
78+
from_docker_repository: ghcr.io/sagemath/sage/
79+
from_docker_target: "with-targets"
80+
from_docker_tag: "dev"
81+
docker_targets: "with-targets"
82+
targets: "${{needs.changed_files.outputs.uninstall_targets}} ${{needs.changed_files.outputs.build_targets}} build doc-html ptest"
83+
tox_system_factors: >-
84+
["ubuntu-focal",
85+
"ubuntu-jammy",
86+
"ubuntu-mantic,
87+
"debian-bullseye",
88+
"debian-bookworm",
89+
"ubuntu-mantic,
90+
"fedora-30",
91+
"fedora-38",
92+
"gentoo-python3.11",
93+
"debian-bullseye-i386"]
94+
tox_packages_factors: >-
95+
["standard",
96+
"minimal"]
97+
docker_push_repository: ghcr.io/${{ github.repository }}/

.github/workflows/ci-linux.yml

+50
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,56 @@ jobs:
6363
["standard"]
6464
docker_push_repository: ghcr.io/${{ github.repository }}/
6565

66+
standard-sitepackages:
67+
if: ${{ success() || failure() }}
68+
needs: [standard-pre]
69+
uses: ./.github/workflows/docker.yml
70+
with:
71+
# Build incrementally from previous stage (pre)
72+
incremental: true
73+
free_disk_space: true
74+
from_docker_repository: ghcr.io/${{ github.repository }}/
75+
from_docker_target: "with-targets-pre"
76+
docker_targets: "with-targets with-targets-optional"
77+
# FIXME: duplicated from env.TARGETS
78+
targets: build doc-html
79+
targets_optional: ptest
80+
tox_packages_factors: >-
81+
["standard-sitepackages"]
82+
# Only test systems with a usable system python (>= 3.9)
83+
tox_system_factors: >-
84+
["ubuntu-jammy",
85+
"ubuntu-kinetic",
86+
"ubuntu-lunar",
87+
"ubuntu-mantic",
88+
"debian-bullseye",
89+
"debian-bookworm",
90+
"debian-trixie",
91+
"debian-sid",
92+
"linuxmint-21",
93+
"linuxmint-21.1",
94+
"linuxmint-21.2",
95+
"fedora-33",
96+
"fedora-34",
97+
"fedora-35",
98+
"fedora-36",
99+
"fedora-37",
100+
"fedora-38",
101+
"fedora-39",
102+
"centos-stream-8-python3.9",
103+
"centos-stream-9-python3.9",
104+
"almalinux-8-python3.9",
105+
"gentoo-python3.10",
106+
"gentoo-python3.11",
107+
"archlinux-latest",
108+
"opensuse-15.4-gcc_11-python3.10",
109+
"opensuse-15.5-gcc_11-python3.11",
110+
"opensuse-tumbleweed-python3.10",
111+
"opensuse-tumbleweed",
112+
"debian-bullseye-i386"]
113+
docker_push_repository: ghcr.io/${{ github.repository }}/
114+
max_parallel: 10
115+
66116
minimal-pre:
67117
if: ${{ success() || failure() }}
68118
# It does not really "need" it.

.github/workflows/docker.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ on:
1818
default: >-
1919
["ubuntu-trusty-toolchain-gcc_9",
2020
"ubuntu-xenial-toolchain-gcc_9",
21+
"ubuntu-bionic-gcc_8",
2122
"ubuntu-focal",
2223
"ubuntu-jammy",
2324
"ubuntu-kinetic",
@@ -56,6 +57,7 @@ on:
5657
"opensuse-15.4-gcc_11-python3.10",
5758
"opensuse-15.5-gcc_11-python3.11",
5859
"opensuse-tumbleweed-python3.10",
60+
"opensuse-tumbleweed",
5961
"conda-forge",
6062
"ubuntu-bionic-gcc_8-i386",
6163
"debian-bullseye-i386",

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"python.linting.enabled": true,
2828
// The following pycodestyle arguments are the same as the pycodestyle-minimal
2929
// tox environnment, see the file SAGE_ROOT/src/tox.ini
30-
"python.linting.pycodestyleArgs": ["--select= E111,E21,E222,E227,E25,E271,E303,E306,E401,E502,E701,E702,E703,E71,E72,W291,W293,W391,W605"],
30+
"python.linting.pycodestyleArgs": ["--select= E111,E21,E222,E227,E25,E271,E303,E305,E306,E401,E502,E701,E702,E703,E71,E72,W291,W293,W391,W605"],
3131
"cSpell.words": [
3232
"furo",
3333
"Conda",

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.2.beta1
7+
version: 10.2.beta2
88
doi: 10.5281/zenodo.593563
9-
date-released: 2023-09-01
9+
date-released: 2023-09-10
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.2.beta1, Release Date: 2023-09-01
1+
SageMath version 10.2.beta2, Release Date: 2023-09-10

build/bin/sage-build-env-config.in

+4
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,13 @@ export SAGE_PARI_CFG="@SAGE_PARI_CFG@"
5353

5454
export SAGE_GLPK_PREFIX="@SAGE_GLPK_PREFIX@"
5555
export SAGE_FREETYPE_PREFIX="@SAGE_FREETYPE_PREFIX@"
56+
export SAGE_PIP_INSTALL_FLAGS="@SAGE_PIP_INSTALL_FLAGS@"
5657
export SAGE_SUITESPARSE_PREFIX="@SAGE_SUITESPARSE_PREFIX@"
5758

5859
export SAGE_CONFIGURE_FFLAS_FFPACK="@SAGE_CONFIGURE_FFLAS_FFPACK@"
5960

6061
export CONFIGURED_SAGE_EDITABLE="@SAGE_EDITABLE@"
6162
export CONFIGURED_SAGE_WHEELS="@SAGE_WHEELS@"
63+
64+
export ENABLE_SYSTEM_SITE_PACKAGES="@ENABLE_SYSTEM_SITE_PACKAGES@"
65+
export PYTHON_MINOR="@PYTHON_MINOR@"

build/bin/sage-dist-helpers

+5-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,11 @@ sdh_store_wheel() {
325325
}
326326

327327
sdh_store_and_pip_install_wheel() {
328-
local pip_options=""
328+
# The $SAGE_PIP_INSTALL_FLAGS variable is set by sage-build-env-config.
329+
# We skip sanity checking its contents since you should either let sage
330+
# decide what it contains, or really know what you are doing.
331+
local pip_options="${SAGE_PIP_INSTALL_FLAGS}"
332+
329333
while [ $# -gt 0 ]; do
330334
case $1 in
331335
-*) pip_options="$pip_options $1"

build/bin/sage-get-system-packages

+14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/sh
2+
23
SYSTEM=$1
34
if [ -z "$SYSTEM" ]; then
45
echo >&2 "usage: $0 {auto|debian|arch|conda|pip|...} SPKGS..."
@@ -10,6 +11,7 @@ SPKGS="$*"
1011
if [ -z "$SAGE_ROOT" ]; then
1112
SAGE_ROOT=`pwd`
1213
fi
14+
1315
case "$SYSTEM" in
1416
install-requires)
1517
# Collect install-requires.txt (falling back to requirements.txt) and output it in the format
@@ -44,6 +46,18 @@ case "$SYSTEM" in
4446
;;
4547
esac
4648
for PKG_BASE in $SPKGS; do
49+
50+
# Skip this package if it uses the SAGE_PYTHON_PACKAGE_CHECK
51+
# macro and if --enable-system-site-packages was NOT passed
52+
# to ./configure (or if ./configure has not yet been run).
53+
SPKG_CONFIGURE="${SAGE_ROOT}/build/pkgs/${PKG_BASE}/spkg-configure.m4"
54+
if [ -z "${ENABLE_SYSTEM_SITE_PACKAGES}" ]; then
55+
if grep -q SAGE_PYTHON_PACKAGE_CHECK "${SPKG_CONFIGURE}" 2>/dev/null;
56+
then
57+
continue;
58+
fi
59+
fi
60+
4761
for NAME in $SYSTEM_PACKAGES_FILE_NAMES; do
4862
SYSTEM_PACKAGES_FILE="$SAGE_ROOT"/build/pkgs/$PKG_BASE/$NAME
4963
if [ -f $SYSTEM_PACKAGES_FILE ]; then

build/bin/sage-spkg-info

+11-9
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,19 @@ if [ -z "$system" ]; then
110110
echo "(none known)"
111111
else
112112
echo
113-
if [ -f "$PKG_SCRIPTS"/spkg-configure.m4 ]; then
114-
echo "If the system package is installed, ./configure will check whether it can be used."
115-
else
116-
echo "However, these system packages will not be used for building Sage"
117-
if [ -f "$PKG_SCRIPTS"/install-requires.txt ]; then
118-
echo "because using Python site-packages is not supported by the Sage distribution;"
119-
echo "see https://github.com/sagemath/sage/issues/29023"
113+
SPKG_CONFIGURE="${PKG_SCRIPTS}/spkg-configure.m4"
114+
if [ -f "${SPKG_CONFIGURE}" ]; then
115+
if grep -q SAGE_PYTHON_PACKAGE_CHECK "${SPKG_CONFIGURE}"; then
116+
echo "If the system package is installed and if the (experimental) option"
117+
echo "--enable-system-site-packages is passed to ./configure, then ./configure"
118+
echo "will check if the system package can be used."
120119
else
121-
echo "because spkg-configure.m4 has not been written for this package;"
122-
echo "see https://github.com/sagemath/sage/issues/27330"
120+
echo "If the system package is installed, ./configure will check if it can be used."
123121
fi
122+
else
123+
echo "However, these system packages will not be used for building Sage"
124+
echo "because spkg-configure.m4 has not been written for this package;"
125+
echo "see https://github.com/sagemath/sage/issues/27330"
124126
fi
125127
fi
126128
echo

build/bin/write-dockerfile.sh

+8-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
set -e
66
SYSTEM="${1:-debian}"
77
shopt -s extglob
8-
SAGE_PACKAGE_LIST_ARGS="${2:- --has-file=spkg-configure.m4 :standard:}"
8+
SAGE_PACKAGE_LIST_ARGS="${2:-:standard:}"
99
WITH_SYSTEM_SPKG="${3:-yes}"
1010
IGNORE_MISSING_SYSTEM_PACKAGES="${4:-no}"
1111
EXTRA_SAGE_PACKAGES="${5:-_bootstrap}"
@@ -15,17 +15,13 @@ SAGE_ROOT=.
1515
export PATH="$SAGE_ROOT"/build/bin:$PATH
1616
SYSTEM_PACKAGES=$EXTRA_SYSTEM_PACKAGES
1717
CONFIGURE_ARGS="--enable-option-checking "
18-
for PKG_BASE in $(sage-package list --has-file=distros/$SYSTEM.txt $SAGE_PACKAGE_LIST_ARGS) $EXTRA_SAGE_PACKAGES; do
19-
PKG_SCRIPTS="$SAGE_ROOT"/build/pkgs/$PKG_BASE
20-
if [ -d $PKG_SCRIPTS ]; then
21-
SYSTEM_PACKAGES_FILE=$PKG_SCRIPTS/distros/$SYSTEM.txt
22-
PKG_SYSTEM_PACKAGES=$(echo $(${STRIP_COMMENTS} $SYSTEM_PACKAGES_FILE))
23-
if [ -n "PKG_SYSTEM_PACKAGES" ]; then
24-
SYSTEM_PACKAGES+=" $PKG_SYSTEM_PACKAGES"
25-
if [ -f $PKG_SCRIPTS/spkg-configure.m4 ]; then
26-
CONFIGURE_ARGS+="--with-system-$PKG_BASE=${WITH_SYSTEM_SPKG} "
27-
fi
28-
fi
18+
for SPKG in $(sage-package list --has-file=spkg-configure.m4 $SAGE_PACKAGE_LIST_ARGS) $EXTRA_SAGE_PACKAGES; do
19+
SYSTEM_PACKAGE=$(sage-get-system-packages $SYSTEM $SPKG | sed 's/${PYTHON_MINOR}/'${PYTHON_MINOR}'/g')
20+
if [ -n "${SYSTEM_PACKAGE}" ]; then
21+
# SYSTEM_PACKAGE can be empty if, for example, the environment
22+
# variable ENABLE_SYSTEM_SITE_PACKAGES is empty.
23+
SYSTEM_PACKAGES+=" ${SYSTEM_PACKAGE}"
24+
CONFIGURE_ARGS+="--with-system-${SPKG}=${WITH_SYSTEM_SPKG} "
2925
fi
3026
done
3127
echo "# Automatically generated by SAGE_ROOT/build/bin/write-dockerfile.sh"

0 commit comments

Comments
 (0)