Skip to content

Commit

Permalink
Merge branch 'develop' into cython-3.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu committed Sep 11, 2024
2 parents f5ab3c6 + 24698e7 commit c39c670
Show file tree
Hide file tree
Showing 446 changed files with 5,466 additions and 2,272 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
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"
]
}
10 changes: 5 additions & 5 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 @@ -503,7 +503,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
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 c39c670

Please sign in to comment.