Skip to content

Commit

Permalink
Merge branch 'develop' into mip_sum_latte
Browse files Browse the repository at this point in the history
  • Loading branch information
xuluze authored Sep 25, 2023
2 parents 5e13295 + 4d3e807 commit 85c85e3
Show file tree
Hide file tree
Showing 1,639 changed files with 24,387 additions and 20,494 deletions.
14 changes: 6 additions & 8 deletions .github/sync_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ReviewDecision(Enum):
"""
changes_requested = 'CHANGES_REQUESTED'
approved = 'APPROVED'
unclear = 'COMMENTED'
unclear = 'UNCLEAR'

class Priority(Enum):
r"""
Expand Down Expand Up @@ -319,12 +319,15 @@ def get_review_decision(self):
return None

if self._review_decision is not None:
if self._review_decision == ReviewDecision.unclear:
return None
return self._review_decision

data = self.view('reviewDecision')
if data:
self._review_decision = ReviewDecision(data)
else:
# To separate a not supplied value from not cached (see https://github.com/sagemath/sage/pull/36177#issuecomment-1704022893 ff)
self._review_decision = ReviewDecision.unclear
info('Review decision for %s: %s' % (self._issue, self._review_decision.value))
return self._review_decision
Expand All @@ -349,9 +352,9 @@ def get_reviews(self, complete=False):
self.get_commits()

date = self._commit_date
no_rev = ReviewDecision.unclear.value
unproper_rev = RevState.commented.value
new_revs = [rev for rev in self._reviews if rev['submittedAt'] > date]
proper_new_revs = [rev for rev in new_revs if rev['state'] != no_rev]
proper_new_revs = [rev for rev in new_revs if rev['state'] != unproper_rev]
info('Proper reviews after %s for %s: %s' % (date, self._issue, proper_new_revs))
return proper_new_revs

Expand Down Expand Up @@ -463,11 +466,6 @@ def approve_allowed(self):
r"""
Return if the actor has permission to approve this PR.
"""
revs = self.get_reviews(complete=True)
if not any(rev['authorAssociation'] in ('MEMBER', 'OWNER') for rev in revs):
info('PR %s can\'t be approved because of missing member review' % (self._issue))
return False

revs = self.get_reviews()
revs = [rev for rev in revs if rev['author']['login'] != self._actor]
ch_req = ReviewDecision.changes_requested
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Update system packages
id: prepare
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/ci-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
- 'public/build/**-runci'
pull_request:
types:
# Defaults
- opened
- synchronize
- reopened
# When a CI label is added
- labeled
workflow_dispatch:
# Allow to run manually
Expand All @@ -21,13 +26,18 @@ jobs:
test:
name: Conda
runs-on: ${{ matrix.os }}
# Run on push, workflow dispatch and when certain labels are added

# Run on push, workflow dispatch and when certain labels are added or are present
if: |
github.event.action != 'labeled' ||
github.event.label.name == 'c: packages: optional' ||
github.event.label.name == 'c: packages: standard' ||
github.event.label.name == 's: run conda ci'
github.event_name != 'pull_request' ||
((github.event.action != 'labeled' &&
(contains(github.event.pull_request.labels.*.name, 'c: packages: standard') ||
contains(github.event.pull_request.labels.*.name, 'c: packages: optional') ||
contains(github.event.pull_request.labels.*.name, 's: run conda ci'))) ||
(github.event.action == 'labeled' &&
(github.event.label.name == 'c: packages: optional' ||
github.event.label.name == 'c: packages: standard' ||
github.event.label.name == 's: run conda ci')))
strategy:
fail-fast: false
Expand All @@ -39,7 +49,7 @@ jobs:
conda-env: [environment]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Check for Miniconda
id: check_conda
Expand Down
96 changes: 96 additions & 0 deletions .github/workflows/ci-linux-incremental.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: CI Linux incremental

## This GitHub Actions workflow runs SAGE_ROOT/tox.ini with select environments,
## whenever a GitHub pull request is opened or synchronized in a repository
## where GitHub Actions are enabled.
##
## It builds and checks some sage spkgs as defined in TARGETS.
##
## A job succeeds if there is no error.
##
## The build is run with "make V=0", so the build logs of individual packages are suppressed.
##
## At the end, all package build logs that contain an error are printed out.
##
## After all jobs have finished (or are canceled) and a short delay,
## tar files of all logs are made available as "build artifacts".

on:
pull_request:
types:
# Defaults
- opened
- synchronize
- reopened
# When a CI label is added
- labeled
workflow_dispatch:

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

permissions:
packages: write

jobs:

changed_files:
runs-on: ubuntu-latest
name: List changed packages
outputs:
uninstall_targets: ${{ steps.build-targets.outputs.uninstall_targets }}
build_targets: ${{ steps.build-targets.outputs.build_targets }}
steps:
- uses: actions/checkout@v4
- name: Get all packages that have changed
id: changed-packages
uses: tj-actions/changed-files@v38
with:
files_yaml: |
configures:
- 'build/pkgs/*/spkg-configure.m4'
pkgs:
- 'build/pkgs/**'
- 'pkgs/**'
- name: Determine targets to build
id: build-targets
run: |
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]*)/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 echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([-_.a-z0-9]*)/[^ ]* *,\2-ensure,;'; done | sort -u))" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
minimal:
needs: [changed_files]
if: |
github.event_name != 'pull_request' ||
((github.event.action != 'labeled' &&
(contains(github.event.pull_request.labels.*.name, 'c: packages: standard') ||
contains(github.event.pull_request.labels.*.name, 'c: packages: optional'))) ||
(github.event.action == 'labeled' &&
(github.event.label.name == 'c: packages: optional' ||
github.event.label.name == 'c: packages: standard')))
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"
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"
tox_system_factors: >-
["ubuntu-focal",
"ubuntu-jammy",
"ubuntu-mantic",
"debian-bullseye",
"debian-bookworm",
"fedora-30",
"fedora-38",
"gentoo-python3.11",
"debian-bullseye-i386"]
tox_packages_factors: >-
["standard",
"minimal"]
docker_push_repository: ghcr.io/${{ github.repository }}/
49 changes: 49 additions & 0 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,55 @@ jobs:
["standard"]
docker_push_repository: ghcr.io/${{ github.repository }}/

standard-sitepackages:
if: ${{ success() || failure() }}
needs: [standard-pre]
uses: ./.github/workflows/docker.yml
with:
# Build incrementally from previous stage (pre)
incremental: true
free_disk_space: true
from_docker_repository: ghcr.io/${{ github.repository }}/
from_docker_target: "with-targets-pre"
docker_targets: "with-targets with-targets-optional"
# FIXME: duplicated from env.TARGETS
targets: build doc-html
targets_optional: ptest
tox_packages_factors: >-
["standard-sitepackages"]
# Only test systems with a usable system python (>= 3.9)
tox_system_factors: >-
["ubuntu-jammy",
"ubuntu-lunar",
"ubuntu-mantic",
"debian-bullseye",
"debian-bookworm",
"debian-trixie",
"debian-sid",
"linuxmint-21",
"linuxmint-21.1",
"linuxmint-21.2",
"fedora-33",
"fedora-34",
"fedora-35",
"fedora-36",
"fedora-37",
"fedora-38",
"fedora-39",
"centos-stream-8-python3.9",
"centos-stream-9-python3.9",
"almalinux-8-python3.9",
"gentoo-python3.10",
"gentoo-python3.11",
"archlinux-latest",
"opensuse-15.4-gcc_11-python3.10",
"opensuse-15.5-gcc_11-python3.11",
"opensuse-tumbleweed-python3.10",
"opensuse-tumbleweed",
"debian-bullseye-i386"]
docker_push_repository: ghcr.io/${{ github.repository }}/
max_parallel: 10

minimal-pre:
if: ${{ success() || failure() }}
# It does not really "need" it.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-tox-local-${{ matrix.tox_env }}-${{ matrix.os }}-xcode_${{ matrix.xcode_version_factor }}
LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-local-${{ matrix.tox_env }}--${{ matrix.os }}-xcode_${{ matrix.xcode_version_factor }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Select Xcode version
run: |
if [ ${{ matrix.xcode_version_factor }} != default ]; then sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode_version_factor }}.app; fi
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 500
- name: fetch tags
Expand Down Expand Up @@ -160,7 +160,7 @@ jobs:
TOX_ENV: local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}
LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-local-${{ matrix.tox_system_factor }}-${{ matrix.tox_packages_factor }}-xcode_${{ matrix.xcode_version_factor }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: "!contains(matrix.tox_system_factor, 'nobootstrap')"
- uses: actions/download-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-wsl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- name: Configure git
run: git config --global core.symlinks true
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Ubuntu 20.04 (in WSL)
run: |
(New-Object System.Net.WebClient).DownloadFile("https://aka.ms/wslubuntu2004", "Ubuntu.appx")
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cygwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ jobs:
choco install git python39 python39-pip --source cygwin
- name: Check out SageMath
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ inputs.sage_repo }}
ref: ${{ inputs.sage_ref }}
fetch-depth: 2000

- name: Check out git-trac-command
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: sagemath/git-trac-command
path: git-trac-command
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install bootstrap prerequisites
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get update
Expand All @@ -51,7 +51,7 @@ jobs:
env:
CAN_DEPLOY: ${{ secrets.SAGEMATH_PYPI_API_TOKEN != '' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install bootstrap prerequisites
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get update
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
# Use 'build', not 'pip wheel'
CIBW_BUILD_FRONTEND: build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/download-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc-build-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
container: ghcr.io/sagemath/sage/sage-docker-fedora-31-maximal-with-targets:dev
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Prepare
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
container: ghcr.io/sagemath/sage/sage-ubuntu-focal-standard-with-targets:dev
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Update system packages
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
[Documentation preview for this PR](${{ steps.deploy-netlify.outputs.NETLIFY_URL }}) (built with commit ${{ steps.source-run-info.outputs.sourceHeadSha }}; [changes](${{ steps.deploy-netlify.outputs.NETLIFY_URL }}/CHANGES.html)) is ready! :tada:
- name: Update deployment status PR check
uses: myrotvorets/set-commit-status-action@v1.1.7
uses: myrotvorets/set-commit-status-action@v2.0.0
if: ${{ always() }}
env:
DEPLOY_SUCCESS: Successfully deployed preview.
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ on:
default: >-
["ubuntu-trusty-toolchain-gcc_9",
"ubuntu-xenial-toolchain-gcc_9",
"ubuntu-bionic-gcc_8",
"ubuntu-focal",
"ubuntu-jammy",
"ubuntu-kinetic",
"ubuntu-lunar",
"ubuntu-mantic",
"debian-buster-gcc_spkg",
Expand Down Expand Up @@ -56,6 +56,7 @@ on:
"opensuse-15.4-gcc_11-python3.10",
"opensuse-15.5-gcc_11-python3.11",
"opensuse-tumbleweed-python3.10",
"opensuse-tumbleweed",
"conda-forge",
"ubuntu-bionic-gcc_8-i386",
"debian-bullseye-i386",
Expand Down Expand Up @@ -144,7 +145,7 @@ jobs:
EXTRA_SAGE_PACKAGES: ${{ inputs.extra_sage_packages }}
steps:
- name: Check out SageMath
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ inputs.sage_repo }}
ref: ${{ inputs.sage_ref }}
Expand Down
Loading

0 comments on commit 85c85e3

Please sign in to comment.