Skip to content

Commit 8fa7f12

Browse files
author
Matthias Köppe
authored
Merge branch 'develop' into python3_configure_prepare_312
2 parents 79c6a2d + 439065e commit 8fa7f12

File tree

576 files changed

+36315
-6602
lines changed

Some content is hidden

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

576 files changed

+36315
-6602
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"remoteUser": "vscode",
99

1010
// Setup conda environment
11-
"onCreateCommand": ".devcontainer/onCreate-conda.sh",
11+
"onCreateCommand": ".devcontainer/onCreate-conda.sh || true",
1212

1313
// Install additional features.
1414
"features": {

.devcontainer/downstream-archlinux-latest/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "archlinux:latest downstream Sage",
44
"image": "archlinux:latest",
55
// Create an empty bashrc to avoid the error "No such file or directory" when opening a terminal.
6-
"onCreateCommand": "EXTRA_SYSTEM_PACKAGES='sagemath sagemath-doc' EXTRA_SAGE_PACKAGES='notebook pip' .devcontainer/onCreate.sh && touch ~/.bashrc",
6+
"onCreateCommand": "sed -i '/^NoExtract/d' /etc/pacman.conf; EXTRA_SYSTEM_PACKAGES='sagemath sagemath-doc' EXTRA_SAGE_PACKAGES='notebook pip' .devcontainer/onCreate.sh && touch ~/.bashrc",
77
// There's no SAGE_LOCAL, so remove the symlink 'prefix'.
88
"updateContentCommand": "rm -f prefix && ln -sf /usr venv",
99
"extensions": [

.devcontainer/onCreate-conda.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
set -e
33

44
# Create conda environment
5-
./bootstrap-conda
65
conda install mamba -n base -c conda-forge -y
7-
mamba env create --file src/environment-dev-3.11.yml || mamba env update --file src/environment-dev-3.11.yml
6+
mamba env create --file src/environment-dev-3.11-linux.yml || mamba env update --file src/environment-dev-3.11-linux.yml
87
conda init bash
98

109
# Build sage

.github/workflows/build.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,23 @@ jobs:
172172
MAKE: make -j2 --output-sync=recurse
173173
SAGE_NUM_THREADS: 2
174174

175+
- name: Check that all modules can be imported
176+
run: |
177+
# The following command checks that all modules can be imported.
178+
# The output also includes a long list of modules together with the number of tests in each module.
179+
# This can be ignored.
180+
../sage -python -m pip install pytest-xdist
181+
../sage -python -m pytest -c tox.ini -qq --doctest --collect-only || true
182+
working-directory: ./worktree-image/src
183+
env:
184+
# Increase the length of the lines in the "short summary"
185+
COLUMNS: 120
186+
175187
- name: Pytest
176188
if: contains(github.ref, 'pytest')
177189
run: |
178190
../sage -python -m pip install coverage pytest-xdist
179-
../sage -python -m coverage run -m pytest -c tox.ini --doctest-modules || true
191+
../sage -python -m coverage run -m pytest -c tox.ini --doctest || true
180192
working-directory: ./worktree-image/src
181193
env:
182194
# Increase the length of the lines in the "short summary"

.github/workflows/ci-conda.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ concurrency:
1818
jobs:
1919
test:
2020
name: Conda
21-
runs-on: ${{ matrix.os }}
21+
runs-on: ${{ matrix.os }}-latest
2222

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

41-
- name: Create conda environment files
42-
run: ./bootstrap-conda
43-
4441
- name: Cache conda packages
4542
uses: actions/cache@v3
4643
with:
@@ -57,7 +54,7 @@ jobs:
5754
channels: conda-forge
5855
channel-priority: true
5956
activate-environment: sage
60-
environment-file: src/${{ matrix.conda-env }}-${{ matrix.python }}.yml
57+
environment-file: src/${{ matrix.conda-env }}-${{ matrix.python }}-${{ startsWith(matrix.os, 'macos') && 'macos' || 'linux' }}.yml
6158

6259
- name: Print Conda environment
6360
shell: bash -l {0}

.github/workflows/ci-linux-incremental.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ jobs:
6363
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
6464
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
6565
cat $GITHUB_OUTPUT
66+
- uses: actions/checkout@v4
67+
with:
68+
ref: ${{ github.base_ref }}
69+
path: worktree-base
70+
if: github.base_ref
71+
- name: Compute metrics
72+
run: |
73+
export PATH=build/bin:$PATH
74+
if [ -d worktree-base ]; then
75+
(echo "# $GITHUB_BASE_REF"; SAGE_ROOT=worktree-base sage-package metrics :all:) > base-metrics.txt
76+
(echo "# $GITHUB_REF"; sage-package metrics :all:) > metrics.txt
77+
diff --color=always --width=100 --side-by-side --left-column base-metrics.txt metrics.txt || true
78+
else
79+
sage-package metrics :all:
80+
fi
6681
6782
test:
6883
needs: [changed_files]
@@ -83,7 +98,7 @@ jobs:
8398
from_docker_target: "with-targets"
8499
from_docker_tag: "dev"
85100
docker_targets: "with-targets"
86-
targets: "${{needs.changed_files.outputs.uninstall_targets}} ${{needs.changed_files.outputs.build_targets}} build doc-html ptest"
101+
targets: "${{needs.changed_files.outputs.uninstall_targets}} reconfigure ${{needs.changed_files.outputs.build_targets}} build doc-html ptest"
87102
tox_system_factors: >-
88103
["ubuntu-focal",
89104
"ubuntu-jammy",
@@ -119,7 +134,7 @@ jobs:
119134
from_docker_target: "with-targets"
120135
from_docker_tag: "dev"
121136
docker_targets: "with-targets"
122-
targets: "${{needs.changed_files.outputs.uninstall_targets}} ${{needs.changed_files.outputs.build_targets}} build doc-html ptest"
137+
targets: "${{needs.changed_files.outputs.uninstall_targets}} reconfigure ${{needs.changed_files.outputs.build_targets}} build doc-html ptest"
123138
# Only test systems with a usable system python (>= 3.9)
124139
# with only a small number of test failures as of 10.2.rc0
125140
tox_system_factors: >-
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env python3
2+
3+
from pathlib import Path
4+
import subprocess
5+
6+
script_dir = Path(__file__).resolve().parent
7+
root_dir = script_dir / '..' / '..'
8+
9+
subprocess.run([str(root_dir / "bootstrap-conda")])
10+
11+
platforms = {
12+
"linux-64": "linux",
13+
"linux-aarch64": "linux-aarch64",
14+
"osx-64": "macos",
15+
"osx-arm64": "macos-arm64"
16+
#"win-64": "win",
17+
}
18+
pythons = ["3.9", "3.10", "3.11"]
19+
tags = ["", "-dev"]
20+
sources = ["", "src"]
21+
22+
for platform_key, platform_value in platforms.items():
23+
for python in pythons:
24+
for tag in tags:
25+
for src in sources:
26+
env_file = root_dir / src / f"environment{tag}-{python}.yml"
27+
lock_file = root_dir / src / f"environment{tag}-{python}-{platform_value}"
28+
29+
if not env_file.exists():
30+
continue
31+
32+
print(f"Updating lock file for {env_file} at {lock_file}", flush=True)
33+
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)])

.gitpod.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ tasks:
77
- name: Setup
88
# Create conda environment, then configure and build sage
99
init: >-
10-
./bootstrap-conda
11-
&& mamba env create --file src/environment-dev-3.11.yml --prefix venv
10+
&& mamba env create --file src/environment-dev-3.11-linux.yml --prefix venv
1211
&& conda config --append envs_dirs $(pwd)
1312
&& conda activate $(pwd)/venv
1413
&& ./bootstrap

.vscode/launch.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
{
22
"version": "0.2.0",
33
"configurations": [
4+
{
5+
"name": "Sage: Pytest Doctests",
6+
"type": "python",
7+
"request": "launch",
8+
"module": "pytest",
9+
"args": [
10+
"-c",
11+
"src/tox.ini",
12+
"--doctest",
13+
"${file}"
14+
],
15+
"console": "integratedTerminal",
16+
"justMyCode": false
17+
},
418
{
519
"name": "Sage: Pytest",
620
"type": "python",
@@ -33,4 +47,4 @@
3347
"justMyCode": false
3448
}
3549
],
36-
}
50+
}

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@
3535
"sagemath",
3636
"Cython"
3737
],
38-
"editor.formatOnType": true
38+
"editor.formatOnType": true,
39+
"esbonio.sphinx.confDir": ""
3940
}

0 commit comments

Comments
 (0)