Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge #28925
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Feb 14, 2022
2 parents efbc045 + 5546c63 commit be39670
Show file tree
Hide file tree
Showing 730 changed files with 15,981 additions and 5,666 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build documentation

on:
push:
workflow_dispatch:
# Allow to run manually

concurrency:
# Cancel previous runs of this workflow for the same branch
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-docs:
runs-on: ubuntu-latest
container: ghcr.io/sagemath/sage/sage-docker-ubuntu-focal-standard-with-targets:9.5
if: github.repository == 'sagemath/sagetrac-mirror'
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Prepare
run: |
# Reuse built SAGE_LOCAL contained in the Docker image
./bootstrap
./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv
- name: Build
run: make doc-html
env:
MAKE: make -j2
SAGE_NUM_THREADS: 2

- name: Copy docs
run: |
# For some reason the deploy step below cannot find /sage/...
# So copy everything from there to local folder
# We also need to replace the symlinks because netlify is not following them
mkdir -p ./docs
cp -r -L /sage/local/share/doc/sage/html/en/* ./docs
- name: Deploy to Netlify preview
id: preview-netlify
if: github.ref != 'refs/heads/develop'
uses: netlify/actions/cli@master
with:
args: deploy --dir=docs --alias="${NETLIFY_ALIAS}"
env:
# Set deployment url to commit hash to easily link from the trac.
# We could also set NETLIFY_ALIAS to the branch name.
# However, netlify currently doesn't support updates to a deployment with the same alias
# https://github.com/netlify/cli/issues/948
# https://github.com/netlify/cli/issues/1984
# Note that even if this feature is implemented, one would also need to first process the branch name
# to workaround the bug https://github.com/netlify/cli/issues/969.
NETLIFY_ALIAS: ${{ github.sha }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

- name: Deploy to Netlify production
id: deploy-netlify
if: github.ref == 'refs/heads/develop'
uses: netlify/actions/cli@master
with:
args: deploy --dir=docs --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

- name: Report deployment url
run: |
echo "::notice::The documentation has being automatically deployed to Netlify. %0A ✅ Preview: ${{ steps.preview-netlify.outputs.NETLIFY_URL || steps.deploy-netlify.outputs.NETLIFY_URL }}"
31 changes: 31 additions & 0 deletions .github/workflows/ticket.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# CI Test For Individual Tickets

name: Ticket CI

on:
push:
branches:
# Once set to positive review, the branch from the trac ticket
# number 12345 will be copied to ticket/12345
- 'ticket/**'


jobs:
ticket_ci:

# TODO: this action is only a placeholder, github actions needs
# this in the master branch to enable it

name: Ticket CI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install pycodestyle
run: pip install tox pycodestyle
- name: Lint using pycodestyle
run: tox -e pycodestyle-minimal
15 changes: 15 additions & 0 deletions .github/workflows/tox-experimental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,22 @@ jobs:
fi
if echo "$TOKEN" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin; then
echo "DOCKER_PUSH_REPOSITORY=docker.pkg.github.com/${{ github.repository }}/" >> $GITHUB_ENV
echo "DOCKER_CONFIG_FILE=$HOME/.docker/config.json" >> $GITHUB_ENV
fi
# From the docker documentation via .ci/update-env.sh:
# "A tag name must be valid ASCII and may
# contain lowercase and uppercase letters, digits, underscores, periods and
# dashes. A tag name may not start with a period or a dash and may contain a
# maximum of 128 characters."
EXTRA_DOCKER_TAGS=`echo $GITHUB_REF_NAME | tr -d '[:space:]' | tr -c '[:alnum:]_.-' '-' | sed 's/^[-.]*//' | cut -c1-128`
shopt -s extglob
case "$GITHUB_REF_NAME" in
+([0-9]).+([0-9])?(.+([0-9])) )
EXTRA_DOCKER_TAGS="latest dev $EXTRA_DOCKER_TAGS";;
+([0-9]).+([0-9])?(.+([0-9])).@(beta|rc)+([0-9]) )
EXTRA_DOCKER_TAGS="dev $EXTRA_DOCKER_TAGS";;
esac
echo "EXTRA_DOCKER_TAGS=$EXTRA_DOCKER_TAGS" >> $GITHUB_ENV
- run: |
set -o pipefail; EXTRA_DOCKER_BUILD_ARGS="--build-arg USE_MAKEFLAGS=\"-k V=0 SAGE_NUM_THREADS=3\"" tox -e $TOX_ENV -- $TARGETS 2>&1 | sed "/^configure: notice:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: warning:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: error:/s|^|::error file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;"
- name: Copy logs from the docker image or build container
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/tox-optional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,22 @@ jobs:
fi
if echo "$TOKEN" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin; then
echo "DOCKER_PUSH_REPOSITORY=docker.pkg.github.com/${{ github.repository }}/" >> $GITHUB_ENV
echo "DOCKER_CONFIG_FILE=$HOME/.docker/config.json" >> $GITHUB_ENV
fi
# From the docker documentation via .ci/update-env.sh:
# "A tag name must be valid ASCII and may
# contain lowercase and uppercase letters, digits, underscores, periods and
# dashes. A tag name may not start with a period or a dash and may contain a
# maximum of 128 characters."
EXTRA_DOCKER_TAGS=`echo $GITHUB_REF_NAME | tr -d '[:space:]' | tr -c '[:alnum:]_.-' '-' | sed 's/^[-.]*//' | cut -c1-128`
shopt -s extglob
case "$GITHUB_REF_NAME" in
+([0-9]).+([0-9])?(.+([0-9])) )
EXTRA_DOCKER_TAGS="latest dev $EXTRA_DOCKER_TAGS";;
+([0-9]).+([0-9])?(.+([0-9])).@(beta|rc)+([0-9]) )
EXTRA_DOCKER_TAGS="dev $EXTRA_DOCKER_TAGS";;
esac
echo "EXTRA_DOCKER_TAGS=$EXTRA_DOCKER_TAGS" >> $GITHUB_ENV
- run: |
set -o pipefail; EXTRA_DOCKER_BUILD_ARGS="--build-arg USE_MAKEFLAGS=\"-k V=0 SAGE_NUM_THREADS=3\"" tox -e $TOX_ENV -- $TARGETS 2>&1 | sed "/^configure: notice:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: warning:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: error:/s|^|::error file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;"
- name: Copy logs from the docker image or build container
Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ jobs:
fail-fast: false
max-parallel: 20
matrix:
tox_system_factor: [ubuntu-trusty, ubuntu-xenial, ubuntu-bionic, ubuntu-focal, ubuntu-hirsute, ubuntu-impish, ubuntu-jammy, debian-stretch, debian-buster, debian-bullseye, debian-bookworm, debian-sid, linuxmint-17, linuxmint-18, linuxmint-19, linuxmint-19.3, linuxmint-20.1, linuxmint-20.2, linuxmint-20.3, fedora-26, fedora-27, fedora-28, fedora-29, fedora-30, fedora-31, fedora-32, fedora-33, fedora-34, fedora-35, fedora-36, centos-7, centos-8, gentoo-python3.9, gentoo-python3.10, archlinux-latest, opensuse-15, opensuse-15.3, opensuse-tumbleweed, slackware-14.2, conda-forge, ubuntu-bionic-i386, manylinux-2_24-i686, debian-buster-i386, centos-7-i386]
tox_system_factor: [gitpod, ubuntu-trusty, ubuntu-xenial, ubuntu-bionic, ubuntu-focal, ubuntu-hirsute, ubuntu-impish, ubuntu-jammy, debian-stretch, debian-buster, debian-bullseye, debian-bookworm, debian-sid, linuxmint-17, linuxmint-18, linuxmint-19, linuxmint-19.3, linuxmint-20.1, linuxmint-20.2, linuxmint-20.3, fedora-26, fedora-27, fedora-28, fedora-29, fedora-30, fedora-31, fedora-32, fedora-33, fedora-34, fedora-35, fedora-36, centos-7, centos-8, gentoo-python3.9, gentoo-python3.10, archlinux-latest, opensuse-15, opensuse-15.3, opensuse-tumbleweed, slackware-14.2, conda-forge, ubuntu-bionic-i386, manylinux-2_24-i686, debian-buster-i386, centos-7-i386]
tox_packages_factor: [minimal, standard]
env:
TOX_ENV: docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}
LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-docker-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}
DOCKER_TARGETS: configured with-targets with-targets-optional
DOCKER_TARGETS: with-system-packages configured with-targets-pre with-targets with-targets-optional
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -76,7 +76,22 @@ jobs:
fi
if echo "$TOKEN" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin; then
echo "DOCKER_PUSH_REPOSITORY=docker.pkg.github.com/${{ github.repository }}/" >> $GITHUB_ENV
echo "DOCKER_CONFIG_FILE=$HOME/.docker/config.json" >> $GITHUB_ENV
fi
# From the docker documentation via .ci/update-env.sh:
# "A tag name must be valid ASCII and may
# contain lowercase and uppercase letters, digits, underscores, periods and
# dashes. A tag name may not start with a period or a dash and may contain a
# maximum of 128 characters."
EXTRA_DOCKER_TAGS=`echo $GITHUB_REF_NAME | tr -d '[:space:]' | tr -c '[:alnum:]_.-' '-' | sed 's/^[-.]*//' | cut -c1-128`
shopt -s extglob
case "$GITHUB_REF_NAME" in
+([0-9]).+([0-9])?(.+([0-9])) )
EXTRA_DOCKER_TAGS="latest dev $EXTRA_DOCKER_TAGS";;
+([0-9]).+([0-9])?(.+([0-9])).@(beta|rc)+([0-9]) )
EXTRA_DOCKER_TAGS="dev $EXTRA_DOCKER_TAGS";;
esac
echo "EXTRA_DOCKER_TAGS=$EXTRA_DOCKER_TAGS" >> $GITHUB_ENV
- run: |
set -o pipefail; EXTRA_DOCKER_BUILD_ARGS="--build-arg USE_MAKEFLAGS=\"-k V=0 SAGE_NUM_THREADS=3\"" tox -e $TOX_ENV -- $TARGETS 2>&1 | sed "/^configure: notice:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: warning:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: error:/s|^|::error file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;"
- name: Copy logs from the docker image or build container
Expand Down Expand Up @@ -109,7 +124,7 @@ jobs:
strategy:
fail-fast: false
matrix:
stage: ["1", "2", "2-optional-0-g", "2-optional-h-o", "2-optional-p", "2-optional-q-z", "2-experimental-0-g", "2-experimental-h-o", "2-experimental-p", "2-experimental-q-z"]
stage: ["1", "2", "2-optional-0-o", "2-optional-p-z", "2-experimental-0-o", "2-experimental-p-z"]
# python3_xcode is only accepted if enough packages are available from the system
# --> to test "minimal", we would need https://trac.sagemath.org/ticket/30949
tox_env: [homebrew-macos-usrlocal-minimal, homebrew-macos-usrlocal-standard, homebrew-macos-usrlocal-maximal, homebrew-macos-usrlocal-python3_xcode-standard, conda-forge-macos-minimal, conda-forge-macos-standard, conda-forge-macos-maximal]
Expand Down Expand Up @@ -159,7 +174,7 @@ jobs:
2-experimental*) export TARGETS_PRE="build/make/Makefile" TARGETS="build/make/Makefile"
targets_pattern="${{ matrix.stage }}"
targets_pattern="${targets_pattern#2-experimental-}"
export TARGETS_OPTIONAL=$( echo $(export PATH=build/bin:$PATH && sage-package list :experimental: --has-file spkg-install.in && sage-package list :experimental: --has-file spkg-install && sage-package list :experimental: --has-file requirements.txt | grep -v ^_ | grep -v database_stein_watkins\\$ | grep -v polytopes_db_4d | grep -v cplex | grep -v gurobi | grep "^[$targets_pattern]" ) )
export TARGETS_OPTIONAL=$( echo $(export PATH=build/bin:$PATH && (sage-package list :experimental: --has-file spkg-install.in && sage-package list :experimental: --has-file spkg-install && sage-package list :experimental: --has-file requirements.txt) | grep -v ^_ | grep -v database_stein_watkins\\$ | grep -v polytopes_db_4d | grep -v cplex | grep -v gurobi | grep "^[$targets_pattern]" ) )
;;
esac
MAKE="make -j12" tox -e $TOX_ENV -- SAGE_NUM_THREADS=4 $TARGETS
Expand Down
117 changes: 117 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Use custom docker image. https://www.gitpod.io/docs/config-docker
image:
# Each of these two options works:
# - Directly use the "-with-targets" image built by .github/workflows/tox.yml
# image: ghcr.io/sagemath/sage/sage-docker-gitpod-standard-with-targets:dev
# - or go through a custom Dockerfile, which builds a smaller image
# based on the "-with-system-packages" image built by .github/workflows/tox.yml
# with the built SAGE_LOCAL from the "-with-targets" image copied in.
file: docker/.gitpod.Dockerfile

# We use the following layout:
#
# $HOME/sage Source tree used by the Docker build; see SAGE_ROOT/tox.ini (gitpod).
# - We delete it in every invocation of the 'before' script
# and replace it by a symlink to /workspace/...
# (This symlink is needed because the package-removal scripts
# ({prefix,venv}/var/lib/sage/scripts/*/{spkg-piprm,spkg-prerm,spkg-postrm)
# hardcode SAGE_ROOT and SAGE_SRC from package installation time)
# $HOME/sage/logs Logs of the Docker build.
# - In the first invocation of the 'before' script, we move it
# to /workspace/.../logs
# $HOME/sage-local The configured prefix (SAGE_LOCAL) of the Sage installation.
# - During the Docker build, this is the physical location.
# - In the first invocation of the 'before' script, we move it
# to the new physical location /workspace/.../local
# (because gitpod only preserves the contents of /workspace)
# and replace it by a symlink to the new physical location.
# - In subsequent invocations of the 'before' script, we
# remove it and replace it by a symlink to the physical
# location /workspace/.../local
# /worktree/.../local The physical location of the Sage installation,
# established in the first run of the 'before' script and
# preserved by gitpod.

# Start up tasks. https://www.gitpod.io/docs/config-start-tasks/
tasks:
- name: Setup
before: |
# Setup ssh key for authentication with trac
## In order to use this, generate a new key with `ssh-keygen -f tempkey` and save the private key to gitpod `gp env PRIVATE_SSH_KEY="$(<tempkey)"` (or by following https://www.gitpod.io/docs/environment-variables#using-the-account-settings)
## then follow https://doc.sagemath.org/html/en/developer/trac.html#linking-your-public-key-to-your-trac-account to register the public key with trac.
mkdir -p ~/.ssh
echo $PRIVATE_SSH_KEY | sed 's/\(-----\(BEGIN\|END\) OPENSSH PRIVATE KEY-----\)/\n\1\n/g' > ~/.ssh/id_rsa
sed -i '/^$/d' ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
unset PRIVATE_SSH_KEY
ssh-keyscan -H trac.sagemath.org >> ~/.ssh/known_hosts
## No need for pyenv
pyenv shell --unset
pyenv global system
if [ -d local ]; then
mkdir -p logs && echo '### .gitpod.yml Setup.before: Prebuild init script has been run. Running "make" again in case the build had timed out.' >> logs/install.log
# The init script has already populated the SAGE_LOCAL,
# but only /workspace is preserved; and the $HOME/sage-local may contain a resurrected
# copy of sage-local. Replace it again by a symlink.
rm -Rf $HOME/sage-local
ln -sf $(pwd)/local $HOME/sage-local
# Now run make. No timeout here.
MAKE='make -j24' make build V=0
else
# Prebuild init script has not been run
# Only /workspace is preserved during build.
# If the Docker image contains a built SAGE_LOCAL, use it to populate the SAGE_LOCAL in the workspace.
if [ -d $HOME/sage-local ]; then
mv $HOME/sage-local local
fi
rm -Rf $HOME/sage-local
ln -sf $(pwd)/local $HOME/sage-local
# Save the logs of the source tree used by the Docker build
if [ -d $HOME/sage/logs ]; then
mv $HOME/sage/logs logs
fi
fi
# Remove the source tree used by the Docker build and replace it by a symlink
rm -Rf $HOME/sage
ln -s $(pwd) $HOME/sage
init: |
# Setup trac repo
git remote add trac [email protected]:sage.git -t master
git remote set-url --push trac [email protected]:sage.git
# Start build
mkdir -p logs && echo '### .gitpod.yml Setup.init: Starting build' >> logs/install.log
./bootstrap
./configure --enable-editable --enable-download-from-upstream-url --prefix=$HOME/sage-local --with-sage-venv
## Gitpod has a timeout of 1h, so make sure we are below this to ensure that the prebuild is always successful
MAKE='make -j24' timeout 51m make build V=0 || echo "(ignoring error)"
env:
SAGE_NUM_THREADS: 8

# Preinstalled VS Code extensions. https://www.gitpod.io/docs/vscode-extensions
vscode:
extensions:
- ms-pyright.pyright
- ms-python.python
- trond-snekvik.simple-rst
- lextudio.restructuredtext
- streetsidesoftware.code-spell-checker
- ms-toolsai.jupyter

# https://www.gitpod.io/docs/prebuilds#github-specific-configuration
github:
prebuilds:
# enable for the default branch (defaults to true)
master: true
# enable for all branches in this repo (defaults to false)
branches: true
# enable for pull requests coming from this repo (defaults to true)
pullRequests: true
# enable for pull requests coming from forks (defaults to false)
pullRequestsFromForks: true
# add a check to pull requests (defaults to true)
addCheck: true
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
addComment: true
# add a "Review in Gitpod" button to the pull request's description (defaults to false)
addBadge: true
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"python.venvPath": "./venv/bin/python",
"python.defaultInterpreterPath": "./venv/bin/python",
"python.dataScience.jupyterServerURI": "local",
"python.pythonPath": "./venv/bin/python",
"files.exclude": {
"**/__pycache__": true,
"src/**/*.cpp": true,
Expand Down
8 changes: 4 additions & 4 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"description": "Mirror of the Sage https://sagemath.org/ source tree",
"license": "other-open",
"title": "sagemath/sage: 9.5.rc3",
"version": "9.5.rc3",
"title": "sagemath/sage: 9.6.beta1",
"version": "9.6.beta1",
"upload_type": "software",
"publication_date": "2022-01-18",
"publication_date": "2022-02-13",
"creators": [
{
"affiliation": "SageMath.org",
Expand All @@ -15,7 +15,7 @@
"related_identifiers": [
{
"scheme": "url",
"identifier": "https://github.com/sagemath/sage/tree/9.5.rc3",
"identifier": "https://github.com/sagemath/sage/tree/9.6.beta1",
"relation": "isSupplementTo"
},
{
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ PTESTALL = ./sage -t -p --all
# When the documentation is installed, "optional" also includes all tests marked 'sagemath_doc_html',
# see https://trac.sagemath.org/ticket/25345, https://trac.sagemath.org/ticket/26110, and
# https://trac.sagemath.org/ticket/32759
TESTALL_FLAGS = --optional=sage,optional,external,build
TESTALL_FLAGS = --optional=sage,optional,external

test: all
$(TESTALL) --logfile=logs/test.log
Expand Down
Loading

0 comments on commit be39670

Please sign in to comment.