Skip to content

Commit

Permalink
Merge branch 'develop' into bug/AbelianGroup.Subgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
amanmoon authored Jan 16, 2024
2 parents adaeec9 + 439065e commit 300c530
Show file tree
Hide file tree
Showing 583 changed files with 36,390 additions and 6,634 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"remoteUser": "vscode",

// Setup conda environment
"onCreateCommand": ".devcontainer/onCreate-conda.sh",
"onCreateCommand": ".devcontainer/onCreate-conda.sh || true",

// Install additional features.
"features": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "archlinux:latest downstream Sage",
"image": "archlinux:latest",
// Create an empty bashrc to avoid the error "No such file or directory" when opening a terminal.
"onCreateCommand": "EXTRA_SYSTEM_PACKAGES='sagemath sagemath-doc' EXTRA_SAGE_PACKAGES='notebook pip' .devcontainer/onCreate.sh && touch ~/.bashrc",
"onCreateCommand": "sed -i '/^NoExtract/d' /etc/pacman.conf; EXTRA_SYSTEM_PACKAGES='sagemath sagemath-doc' EXTRA_SAGE_PACKAGES='notebook pip' .devcontainer/onCreate.sh && touch ~/.bashrc",
// There's no SAGE_LOCAL, so remove the symlink 'prefix'.
"updateContentCommand": "rm -f prefix && ln -sf /usr venv",
"extensions": [
Expand Down
3 changes: 1 addition & 2 deletions .devcontainer/onCreate-conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
set -e

# Create conda environment
./bootstrap-conda
conda install mamba -n base -c conda-forge -y
mamba env create --file src/environment-dev-3.11.yml || mamba env update --file src/environment-dev-3.11.yml
mamba env create --file src/environment-dev-3.11-linux.yml || mamba env update --file src/environment-dev-3.11-linux.yml
conda init bash

# Build sage
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,23 @@ jobs:
MAKE: make -j2 --output-sync=recurse
SAGE_NUM_THREADS: 2

- name: Check that all modules can be imported
run: |
# The following command checks that all modules can be imported.
# The output also includes a long list of modules together with the number of tests in each module.
# This can be ignored.
../sage -python -m pip install pytest-xdist
../sage -python -m pytest -c tox.ini -qq --doctest --collect-only || true
working-directory: ./worktree-image/src
env:
# Increase the length of the lines in the "short summary"
COLUMNS: 120

- name: Pytest
if: contains(github.ref, 'pytest')
run: |
../sage -python -m pip install coverage pytest-xdist
../sage -python -m coverage run -m pytest -c tox.ini --doctest-modules || true
../sage -python -m coverage run -m pytest -c tox.ini --doctest || true
working-directory: ./worktree-image/src
env:
# Increase the length of the lines in the "short summary"
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/ci-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ concurrency:
jobs:
test:
name: Conda
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest

strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu, macos]
python: ['3.9', '3.10', '3.11']
# Optional environment is disabled for now as its not yet working
# environment: [environment, environment-optional]
Expand All @@ -38,9 +38,6 @@ jobs:
GH_TOKEN: ${{ github.token }}
SAGE_CI_FIXES_FROM_REPOSITORIES: ${{ vars.SAGE_CI_FIXES_FROM_REPOSITORIES }}

- name: Create conda environment files
run: ./bootstrap-conda

- name: Cache conda packages
uses: actions/cache@v3
with:
Expand All @@ -57,7 +54,7 @@ jobs:
channels: conda-forge
channel-priority: true
activate-environment: sage
environment-file: src/${{ matrix.conda-env }}-${{ matrix.python }}.yml
environment-file: src/${{ matrix.conda-env }}-${{ matrix.python }}-${{ startsWith(matrix.os, 'macos') && 'macos' || 'linux' }}.yml

- name: Print Conda environment
shell: bash -l {0}
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/ci-linux-incremental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,21 @@ jobs:
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][_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'; done | sort -u))" >> $GITHUB_OUTPUT
echo "build_targets=$(echo $(for a in '' ${{ steps.changed-packages.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))" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
path: worktree-base
if: github.base_ref
- name: Compute metrics
run: |
export PATH=build/bin:$PATH
if [ -d worktree-base ]; then
(echo "# $GITHUB_BASE_REF"; SAGE_ROOT=worktree-base sage-package metrics :all:) > base-metrics.txt
(echo "# $GITHUB_REF"; sage-package metrics :all:) > metrics.txt
diff --color=always --width=100 --side-by-side --left-column base-metrics.txt metrics.txt || true
else
sage-package metrics :all:
fi
test:
needs: [changed_files]
Expand All @@ -83,7 +98,7 @@ jobs:
from_docker_target: "with-targets"
from_docker_tag: "dev"
docker_targets: "with-targets"
targets: "${{needs.changed_files.outputs.uninstall_targets}} ${{needs.changed_files.outputs.build_targets}} build doc-html ptest"
targets: "${{needs.changed_files.outputs.uninstall_targets}} reconfigure ${{needs.changed_files.outputs.build_targets}} build doc-html ptest"
tox_system_factors: >-
["ubuntu-focal",
"ubuntu-jammy",
Expand Down Expand Up @@ -119,7 +134,7 @@ jobs:
from_docker_target: "with-targets"
from_docker_tag: "dev"
docker_targets: "with-targets"
targets: "${{needs.changed_files.outputs.uninstall_targets}} ${{needs.changed_files.outputs.build_targets}} build doc-html ptest"
targets: "${{needs.changed_files.outputs.uninstall_targets}} reconfigure ${{needs.changed_files.outputs.build_targets}} build doc-html ptest"
# Only test systems with a usable system python (>= 3.9)
# with only a small number of test failures as of 10.2.rc0
tox_system_factors: >-
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/conda-lock-update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env python3

from pathlib import Path
import subprocess

script_dir = Path(__file__).resolve().parent
root_dir = script_dir / '..' / '..'

subprocess.run([str(root_dir / "bootstrap-conda")])

platforms = {
"linux-64": "linux",
"linux-aarch64": "linux-aarch64",
"osx-64": "macos",
"osx-arm64": "macos-arm64"
#"win-64": "win",
}
pythons = ["3.9", "3.10", "3.11"]
tags = ["", "-dev"]
sources = ["", "src"]

for platform_key, platform_value in platforms.items():
for python in pythons:
for tag in tags:
for src in sources:
env_file = root_dir / src / f"environment{tag}-{python}.yml"
lock_file = root_dir / src / f"environment{tag}-{python}-{platform_value}"

if not env_file.exists():
continue

print(f"Updating lock file for {env_file} at {lock_file}", flush=True)
subprocess.run(["conda-lock", "--channel", "conda-forge", "--kind", "env", "--platform", platform_key, "--file", str(env_file), "--lockfile", str(lock_file), "--filename-template", str(lock_file)])
3 changes: 1 addition & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ tasks:
- name: Setup
# Create conda environment, then configure and build sage
init: >-
./bootstrap-conda
&& mamba env create --file src/environment-dev-3.11.yml --prefix venv
&& mamba env create --file src/environment-dev-3.11-linux.yml --prefix venv
&& conda config --append envs_dirs $(pwd)
&& conda activate $(pwd)/venv
&& ./bootstrap
Expand Down
16 changes: 15 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Sage: Pytest Doctests",
"type": "python",
"request": "launch",
"module": "pytest",
"args": [
"-c",
"src/tox.ini",
"--doctest",
"${file}"
],
"console": "integratedTerminal",
"justMyCode": false
},
{
"name": "Sage: Pytest",
"type": "python",
Expand Down Expand Up @@ -33,4 +47,4 @@
"justMyCode": false
}
],
}
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
"sagemath",
"Cython"
],
"editor.formatOnType": true
"editor.formatOnType": true,
"esbonio.sphinx.confDir": ""
}
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.3.beta4
version: 10.3.beta5
doi: 10.5281/zenodo.593563
date-released: 2023-12-26
date-released: 2024-01-14
repository-code: "https://github.com/sagemath/sage"
url: "https://www.sagemath.org/"
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ SPKG_COLLECT_FILES = build/pkgs/*/type build/pkgs/*/package-version.txt build/pk
# If configure was run before, rerun it with the old arguments.
# Otherwise, run configure with argument $PREREQ_OPTIONS.
build/make/Makefile: configure $(SPKG_COLLECT_FILES) $(CONFIG_FILES:%=%.in)
$(MAKE) reconfigure

reconfigure:
rm -f config.log
mkdir -p logs/pkgs
ln -s logs/pkgs/config.log config.log
Expand Down Expand Up @@ -339,7 +342,7 @@ list:
@$(MAKE) --silent build/make/Makefile >&2
@$(MAKE) --silent -f build/make/Makefile SAGE_PKGCONFIG=dummy $@

.PHONY: default build dist install micro_release \
.PHONY: default build dist install micro_release reconfigure \
misc-clean bdist-clean distclean bootstrap-clean maintainer-clean \
test check testoptional testall testlong testoptionallong testallong \
ptest ptestoptional ptestall ptestlong ptestoptionallong ptestallong \
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SageMath version 10.3.beta4, Release Date: 2023-12-26
SageMath version 10.3.beta5, Release Date: 2024-01-14
4 changes: 2 additions & 2 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ EOF
if test -f "$DIR/requirements.txt" -o -f "$DIR/install-requires.txt"; then
# A Python package
SPKG_TREE_VAR=SAGE_VENV
echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(ENABLE_SYSTEM_SITE_PACKAGES=yes sage-get-system-packages install-requires ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions.m4
echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(ENABLE_SYSTEM_SITE_PACKAGES=yes sage-get-system-packages install-requires-toml ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions_toml.m4
echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions.m4
echo "define(>>>SPKG_INSTALL_REQUIRES_${pkgname}<<<, >>>$(echo $(sage-get-system-packages install-requires-toml ${pkgname}))<<<)dnl" >> m4/sage_spkg_versions_toml.m4
fi
fi
spkg_finalizes="$spkg_finalizes
Expand Down
1 change: 1 addition & 0 deletions bootstrap-conda
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ echo >&2 $0:$LINENO: generate conda environment files
(
sed 's/name: sage/name: sage-dev/' src/environment-template.yml
echo " # Additional dev tools"
echo " - conda-lock"
for pkg in $DEVELOP_SYSTEM_PACKAGES; do
echo " - $pkg"
done
Expand Down
32 changes: 22 additions & 10 deletions build/bin/sage-get-system-packages
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,28 @@ case "$SYSTEM" in
esac
for PKG_BASE in $SPKGS; do

# Skip this package if it uses the SAGE_PYTHON_PACKAGE_CHECK
# macro and if --enable-system-site-packages was NOT passed
# to ./configure (or if ./configure has not yet been run).
SPKG_CONFIGURE="${SAGE_ROOT}/build/pkgs/${PKG_BASE}/spkg-configure.m4"
if [ -z "${ENABLE_SYSTEM_SITE_PACKAGES}" ]; then
if grep -q SAGE_PYTHON_PACKAGE_CHECK "${SPKG_CONFIGURE}" 2>/dev/null;
then
continue;
fi
fi
case "$SYSTEM:$ENABLE_SYSTEM_SITE_PACKAGES" in
install-requires*|pip*)
# This is output for installation of packages into a Python environment.
# So it's OK to use any Python packages.
;;
*:)
# --enable-system-site-packages was NOT passed to configure
# (or script was run outside of the sage-build-env).
#
# Skip this package if it uses the SAGE_PYTHON_PACKAGE_CHECK macro.
#
SPKG_CONFIGURE="${SAGE_ROOT}/build/pkgs/${PKG_BASE}/spkg-configure.m4"
if grep -q SAGE_PYTHON_PACKAGE_CHECK "${SPKG_CONFIGURE}" 2>/dev/null;
then
continue
fi
;;
*)
# --enable-system-site-packages was passed to configure.
# So any package (Python, non-Python) is fine.
;;
esac

for NAME in $SYSTEM_PACKAGES_FILE_NAMES; do
SYSTEM_PACKAGES_FILE="$SAGE_ROOT"/build/pkgs/$PKG_BASE/$NAME
Expand Down
5 changes: 2 additions & 3 deletions build/bin/write-dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ EOF
ENDRUN=\'
;;
void*)
# https://hub.docker.com/r/voidlinux/masterdir-x86_64-musl
UPDATE="xbps-install -Su &&"
EXISTS="xbps-query"
UPDATE="xbps-install -Suy &&"
EXISTS="xbps-query -R"
INSTALL="xbps-install --yes"
;;
opensuse*)
Expand Down
15 changes: 15 additions & 0 deletions build/pkgs/_prereq/distros/void.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,19 @@ make
perl
python3
tar
bash
which
# needed by gfortran
diffutils
# needed by ppl
gzip
# void may need special patches for musl libc support in python3,
# so require full python 3 and its prereqs
python3-devel
bzip2-devel
xz
liblzma-devel
libffi-devel
zlib-devel
# to build python3 with the crypto module; there may be other packages that need it
libxcrypt-devel
1 change: 1 addition & 0 deletions build/pkgs/_python3.11/distros/void.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python3.11-devel
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=05115739db242cb5a48ae17f97d06b179fc70334
md5=adc8208885e6be527b089b682079c464
cksum=3321256447
sha1=1041fee1d3ed5dc9c6c428668a895fb7109a48e5
md5=e254e55345074cd0959cb21c8e4716ca
cksum=1271538328
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e95536ccbad199de456e804968a775f2744e4bff
c6bf497a0fd0f29c721481b52afaf49969c0cef8
6 changes: 3 additions & 3 deletions build/pkgs/cython/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=Cython-VERSION.tar.gz
sha1=94945822403911b75608fa9689039187686437dd
md5=3b08e76d112619ed9b5bc240b6b53cf4
cksum=467020180
sha1=48f0535ce0b05e0e4ae4daa6a597a2cdd76274f5
md5=94ab8466d9350a31cfef3a0853c2fea5
cksum=2507297160
upstream_url=https://pypi.io/packages/source/C/Cython/Cython-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/cython/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.6
3.0.7
Loading

0 comments on commit 300c530

Please sign in to comment.