Skip to content

Commit

Permalink
Merge branch 'develop' into no-pari-2.17
Browse files Browse the repository at this point in the history
  • Loading branch information
jhpalmieri authored Oct 5, 2024
2 parents 72085e2 + b0f09d9 commit f366e88
Show file tree
Hide file tree
Showing 860 changed files with 14,965 additions and 7,646 deletions.
29 changes: 19 additions & 10 deletions .ci/create-changes-html.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/sh
if [ $# != 2 ]; then
echo >&2 "usage: $0 BASE_DOC_COMMIT DOC_REPO"
echo >&2 "creates CHANGES.html in the current directory"
echo >&2 "for the diffs of DOC_REPO against BASE_DOC_COMMIT"
echo >&2 "Usage: $0 DIFF_TEXT DOC_REPO"
echo >&2 "This script generates a CHANGES.html file in the current directory"
echo >&2 "and adds anchor targets in the documents within DOC_REPO"
echo >&2 "based on the diff hunks in the DIFF_TEXT file."
exit 1
fi
BASE_DOC_COMMIT="$1"
DIFF_TEXT="$1"
DOC_REPOSITORY="$2"

# Create CHANGES.html
Expand Down Expand Up @@ -52,11 +53,10 @@ diffParagraphs.forEach(paragraph => {
EOF
echo '</head>' >> CHANGES.html
echo '<body>' >> CHANGES.html
(cd $DOC_REPOSITORY && git diff $BASE_DOC_COMMIT -- "*.html") > diff.txt
python3 - << EOF
import os, re, html
from itertools import chain
with open('diff.txt', 'r') as f:
with open('$DIFF_TEXT', 'r') as f:
diff_text = f.read()
diff_blocks = re.split(r'^(?=diff --git)', diff_text, flags=re.MULTILINE)
out_blocks = []
Expand All @@ -83,12 +83,21 @@ for block in diff_blocks:
hunk_lines = []
search_result = re.search(r'@@ -(\d+),(\d+) \+(\d+),(\d+)', line)
if search_result:
line_number = int(search_result.group(3))
line_number = int(search_result.group(3)) - 1
span = int(search_result.group(4))
for i in chain(range(line_number, line_number + span), range(line_number - 1, -1, -1)):
if content[i].startswith('<') and not content[i].startswith('</'):
try:
ln = content[i]
except IndexError:
continue
for idx, char in enumerate(ln):
if not char.isspace():
break
else:
idx = len(ln)
if ln.startswith('<', idx) and not ln.startswith('</', idx):
count += 1
content[i] = f'<span id="hunk{count}" style="visibility: hidden;"></span>' + content[i]
content[i] = ln[:idx] + f'<span id="hunk{count}" style="visibility: hidden;"></span>' + ln[idx:]
hunks.append(f'<p class="hunk"><a href="{path}#hunk{count}" class="hunk" target="_blank">hunk #{count}</a></p>')
break
hunk_lines.append(line)
Expand All @@ -107,4 +116,4 @@ EOF
cat diff.html >> CHANGES.html
echo '</body>' >> CHANGES.html
echo '</html>' >> CHANGES.html
rm diff.txt diff.html
rm diff.html
2 changes: 1 addition & 1 deletion .ci/retrofit-worktree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ git worktree add --detach $WORKTREE_NAME
rm -rf $WORKTREE_DIRECTORY/.git && mv $WORKTREE_NAME/.git $WORKTREE_DIRECTORY/
rm -rf $WORKTREE_NAME && ln -s $WORKTREE_DIRECTORY $WORKTREE_NAME
if [ ! -f $WORKTREE_NAME/.gitignore ]; then cp .gitignore $WORKTREE_NAME/; fi
(cd $WORKTREE_NAME && git add -A && git commit --quiet --allow-empty -m "old" -a && git tag -f old && git checkout new && git status)
(cd $WORKTREE_NAME && git add -A && git commit --quiet --allow-empty -m "old" -a && git tag -f old && git checkout -f new && git clean -fd && git status)
4 changes: 2 additions & 2 deletions .ci/write-dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ $ADD .upstream.d /new/.upstream.d
ADD .ci /.ci
RUN if [ -d /sage ]; then \
echo "### Incremental build from \$(cat /sage/VERSION.txt)" && \
printf '/src\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /sage/.gitignore && \
printf '/src\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /new/.gitignore && \
printf '/src/*\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /sage/.gitignore && \
printf '/src/*\n!/src/doc/bootstrap\n!/src/bin\n!/src/*.m4\n!/src/*.toml\n!/src/VERSION.txt\n' >> /new/.gitignore && \
if ! (cd /new && /.ci/retrofit-worktree.sh worktree-image /sage); then \
echo "retrofit-worktree.sh failed, falling back to replacing /sage"; \
for a in local logs; do \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
// from .devcontainer/portability-devcontainer.json.in
// See https://aka.ms/devcontainer.json for format details.
{
"name": "centos-stream-9-python3.9-minimal (≥ 8-core)",
"name": "centos-stream-9-minimal (≥ 8-core)",
"build": {
"dockerfile": "portability-Dockerfile",
// See tox.ini for definitions
"args": {
"SYSTEM_FACTOR": "centos-stream-9-python3.9",
"SYSTEM_FACTOR": "centos-stream-9",
"PACKAGE_FACTOR": "minimal",
"DOCKER_TARGET": "with-targets",
"DOCKER_TAG": "dev"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// The command "tox -e update_docker_platforms"
// creates .devcontainer/portability-*-*/devcontainer.json
// from .devcontainer/portability-devcontainer.json.in
// See https://aka.ms/devcontainer.json for format details.
{
"name": "centos-stream-9-python3.12-minimal (≥ 8-core)",
"build": {
"dockerfile": "portability-Dockerfile",
// See tox.ini for definitions
"args": {
"SYSTEM_FACTOR": "centos-stream-9-python3.12",
"PACKAGE_FACTOR": "minimal",
"DOCKER_TARGET": "with-targets",
"DOCKER_TAG": "dev"
}
},
"containerEnv": {
"MAKE": "make -j4"
},
"onCreateCommand": ".devcontainer/onCreate.sh",
"updateContentCommand": ".devcontainer/portability-updateContent.sh",
"extensions": [
"ms-python.python"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// The command "tox -e update_docker_platforms"
// creates .devcontainer/portability-*-*/devcontainer.json
// from .devcontainer/portability-devcontainer.json.in
// See https://aka.ms/devcontainer.json for format details.
{
"name": "centos-stream-9-python3.12-standard (≥ 8-core)",
"build": {
"dockerfile": "portability-Dockerfile",
// See tox.ini for definitions
"args": {
"SYSTEM_FACTOR": "centos-stream-9-python3.12",
"PACKAGE_FACTOR": "standard",
"DOCKER_TARGET": "with-targets",
"DOCKER_TAG": "dev"
}
},
"containerEnv": {
"MAKE": "make -j4"
},
"onCreateCommand": ".devcontainer/onCreate.sh",
"updateContentCommand": ".devcontainer/portability-updateContent.sh",
"extensions": [
"ms-python.python"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
// from .devcontainer/portability-devcontainer.json.in
// See https://aka.ms/devcontainer.json for format details.
{
"name": "centos-stream-9-python3.9-standard (≥ 8-core)",
"name": "centos-stream-9-standard (≥ 8-core)",
"build": {
"dockerfile": "portability-Dockerfile",
// See tox.ini for definitions
"args": {
"SYSTEM_FACTOR": "centos-stream-9-python3.9",
"SYSTEM_FACTOR": "centos-stream-9",
"PACKAGE_FACTOR": "standard",
"DOCKER_TARGET": "with-targets",
"DOCKER_TAG": "dev"
Expand Down
25 changes: 25 additions & 0 deletions .devcontainer/portability-fedora-41-minimal/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// The command "tox -e update_docker_platforms"
// creates .devcontainer/portability-*-*/devcontainer.json
// from .devcontainer/portability-devcontainer.json.in
// See https://aka.ms/devcontainer.json for format details.
{
"name": "fedora-41-minimal (≥ 8-core)",
"build": {
"dockerfile": "portability-Dockerfile",
// See tox.ini for definitions
"args": {
"SYSTEM_FACTOR": "fedora-41",
"PACKAGE_FACTOR": "minimal",
"DOCKER_TARGET": "with-targets",
"DOCKER_TAG": "dev"
}
},
"containerEnv": {
"MAKE": "make -j4"
},
"onCreateCommand": ".devcontainer/onCreate.sh",
"updateContentCommand": ".devcontainer/portability-updateContent.sh",
"extensions": [
"ms-python.python"
]
}
25 changes: 25 additions & 0 deletions .devcontainer/portability-fedora-41-standard/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// The command "tox -e update_docker_platforms"
// creates .devcontainer/portability-*-*/devcontainer.json
// from .devcontainer/portability-devcontainer.json.in
// See https://aka.ms/devcontainer.json for format details.
{
"name": "fedora-41-standard (≥ 8-core)",
"build": {
"dockerfile": "portability-Dockerfile",
// See tox.ini for definitions
"args": {
"SYSTEM_FACTOR": "fedora-41",
"PACKAGE_FACTOR": "standard",
"DOCKER_TARGET": "with-targets",
"DOCKER_TAG": "dev"
}
},
"containerEnv": {
"MAKE": "make -j4"
},
"onCreateCommand": ".devcontainer/onCreate.sh",
"updateContentCommand": ".devcontainer/portability-updateContent.sh",
"extensions": [
"ms-python.python"
]
}
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ body:
- **OS**: Ubuntu 20.04
- Sage Version: 9.2
value: |
- **OS**:
- **Sage Version**:
render: markdown
- **OS**:
- **Sage Version**:
validations:
required: true
- type: checkboxes
Expand Down
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/failure_building_from_source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ body:
- **OS**: Ubuntu 20.04
- Sage Version: 9.2
value: |
- **OS**:
- **OS**:
- **Sage Version**:
render: markdown
validations:
required: true
- type: textarea
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
uses: actions/checkout@v4
- name: Get changed files and packages
id: changed-files
uses: tj-actions/changed-files@v44
uses: tj-actions/changed-files@v45
with:
# File extensions for doctests per sage.doctest.control.skipfile
files_yaml: |
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:

- name: Build Docker image
id: image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
# push and load may not be set together at the moment
#
Expand Down Expand Up @@ -291,7 +291,7 @@ jobs:

- name: Build Docker image
id: image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
push: true
load: false
Expand Down Expand Up @@ -389,7 +389,7 @@ jobs:

- name: Build Docker image
id: image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
push: true
load: false
Expand Down Expand Up @@ -442,8 +442,11 @@ jobs:
if: (success() || failure()) && steps.container.outcome == 'success'
uses: actions/upload-artifact@v4
with:
# The path .coverage is a directory that contains the combined coverage
# data file .coverage, which is a hidden file because of the leading dot
name: coverage-${{ steps.copy-coverage.outputs.tests_id }}
path: .coverage
include-hidden-files: true

coverage-report:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -503,7 +506,7 @@ jobs:

- name: Build Docker image
id: image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
push: true
load: false
Expand All @@ -530,11 +533,11 @@ jobs:
# Combining

- name: Download coverage artifacts
if: (success() || failure()) && steps.container.outcome == 'success'
uses: actions/download-artifact@v4
with:
path: .coverage
pattern: coverage-*
if: (success() || failure()) && steps.container.outcome == 'success'

- name: Coverage report
if: (success() || failure()) && steps.container.outcome == 'success'
Expand Down
31 changes: 27 additions & 4 deletions .github/workflows/ci-linux-incremental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- uses: actions/checkout@v4
- name: Get all packages that have changed
id: changed-files
uses: tj-actions/changed-files@v44
uses: tj-actions/changed-files@v45
with:
files_yaml: |
configures:
Expand All @@ -60,9 +60,9 @@ jobs:
uninstall_targets=$(echo $(for a in '' ${{ steps.changed-files.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))
build_targets=$(echo $(for a in '' ${{ steps.changed-files.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))
if [ -n "$uninstall_targets" ]; then
echo "build_targets=$uninstall_targets reconfigure $build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT
echo "build_targets=$uninstall_targets reconfigure $build_targets" >> $GITHUB_OUTPUT
else
echo "build_targets=$build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT
echo "build_targets=$build_targets" >> $GITHUB_OUTPUT
fi
cat $GITHUB_OUTPUT
- uses: actions/checkout@v4
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
from_docker_target: "with-targets"
from_docker_tag: "dev"
docker_targets: "with-targets"
targets: "${{needs.changed_files.outputs.build_targets}} doc-html ptest-nodoc"
targets: "${{needs.changed_files.outputs.build_targets}} ci-build-with-fallback doc-html ptest-nodoc"
tox_system_factors: >-
["ubuntu-focal",
"ubuntu-noble",
Expand All @@ -108,6 +108,29 @@ jobs:
docker_push_repository: ghcr.io/${{ github.repository }}/
max_parallel: 8

constraints_pkgs-norequirements:
needs: [changed_files]
uses: ./.github/workflows/docker.yml
with:
# Build incrementally from published Docker image
incremental: true
free_disk_space: true
from_docker_repository: ghcr.io/sagemath/sage/
from_docker_target: "with-targets-pre"
from_docker_tag: "dev"
docker_targets: "with-targets-pre"
targets_pre: "${{needs.changed_files.outputs.build_targets}} all-sage-local python3-ensure tox-ensure sagelib-tox-sagepython-constraints_pkgs-norequirements"
tox_system_factors: >-
["ubuntu-focal",
"ubuntu-noble",
"debian-bookworm",
"fedora-40",
"debian-bullseye-i386"]
tox_packages_factors: >-
["standard"]
docker_push_repository: ghcr.io/${{ github.repository }}/
max_parallel: 16

site:
needs: [changed_files]
uses: ./.github/workflows/docker.yml
Expand Down
Loading

0 comments on commit f366e88

Please sign in to comment.