-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'beta' into master (will become v0.9.10 soon)
- Loading branch information
Showing
923 changed files
with
173,674 additions
and
98,516 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
sudo apt-get update -qq -y && \ | ||
sudo apt-get install -qq -y \ | ||
gfortran libblas-dev liblapack-dev openmpi-bin openmpi-common openssh-client \ | ||
openssh-server libopenmpi2 libopenmpi-dev libsuitesparse-dev | ||
cmake --version | ||
gcc --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#! /usr/bin/env bash | ||
# This script is run by a GitHub Action | ||
# This merges passing builds on the `deploy' branch to `beta' | ||
|
||
GIT_USER="GitHub Action" | ||
GIT_EMAIL="[email protected]" | ||
|
||
# we should only be run during Action | ||
if [ -z "$GITHUB_ACTIONS" ]; then | ||
echo "This script is run automatically by GitHub Actions." | ||
echo "Please don't run it manually!" | ||
echo '... But if you really have to, set $GITHUB_ACTIONS to "true" to bypass this safety check.' | ||
exit 1 | ||
fi | ||
|
||
# trigger only on `develop' by default (configurable) | ||
if [ -z "$TRIGGER_REF" ]; then | ||
TRIGGER_REF="/refs/heads/develop" | ||
fi | ||
|
||
# push to `beta' by default (configurable) | ||
if [ -z "$MERGE_BRANCH" ]; then | ||
MERGE_BRANCH="beta" | ||
fi | ||
|
||
echo "GITHUB_REPOSITORY = $GITHUB_REPOSITORY" | ||
echo "GITHUB_REF = $GITHUB_REF" | ||
echo "TRIGGER_REF = $TRIGGER_REF" | ||
echo "MERGE_BRANCH = $MERGE_BRANCH" | ||
|
||
# Following should only be set for pull requests | ||
PULL_REQUEST=false | ||
if [ -z "$GITHUB_HEAD_REF" ] || [ -z "$GITHUB_BASE_REF" ]; then | ||
PULL_REQUEST=true | ||
fi | ||
echo "PULL_REQUEST = $PULL_REQUEST" | ||
|
||
if [ "$GITHUB_REF" = "$TRIGGER_REF" ] && [ "$PULL_REQUEST" = "false" ]; then | ||
# setup git user | ||
git config user.email "$GIT_EMAIL" | ||
git config user.name "$GIT_USER" | ||
|
||
# branch develop head to beta | ||
git checkout -b "$MERGE_BRANCH" | ||
|
||
# if branch exists upstream, apply it on top of this one | ||
UPSTREAM_URI="[email protected]:$GITHUB_REPOSITORY.git" | ||
UPSTREAM_BRANCH=$(git ls-remote --heads "$UPSTREAM_URI" "$MERGE_BRANCH") | ||
if [ "$?" -eq 0 ] && [ -n "$UPSTREAM_BRANCH" ]; then | ||
git pull --ff-only "$UPSTREAM_URI" "$MERGE_BRANCH" | ||
if [ "$?" -eq 0 ]; then | ||
echo "Fast-forwarded $MERGE_BRANCH to $TRIGGER_REF." | ||
else | ||
echo "ERROR: couldn't fast-forward $MERGE_BRANCH to $TRIGGER_REF!" | ||
echo "These branches must be merged manually." | ||
echo "hint: If you wish to merge these branches automatically in the future," | ||
echo "hint: add the conflicting refs from $PUSH BRANCH to $DEVELOP BRANCH." | ||
exit 2 | ||
fi | ||
fi | ||
else | ||
echo "Not triggering pull: GITHUB_REF != TRIGGER_REF or PULL_REQUEST != false" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Deploy new version on pypi.org | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
|
||
# Allow running manually from Actions tab | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # to fetch all branches and *tags* (needed to get version number correctly) | ||
|
||
- uses: actions/setup-python@v2 | ||
name: Install Python | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* | ||
CIBW_BUILD_VERBOSITY: 1 | ||
CIBW_BEFORE_ALL_LINUX: ./.github/ci-scripts/before_install.sh | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # to fetch all branches and *tags* (needed to get version number correctly) | ||
|
||
- uses: actions/setup-python@v2 | ||
name: Install Python | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Build sdist | ||
run: python setup.py sdist | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: dist/*.tar.gz | ||
|
||
upload_pypi: | ||
needs: [build_wheels, build_sdist] | ||
runs-on: ubuntu-latest | ||
# upload to PyPI on every tag starting with 'v' | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | ||
# alternatively, to publish when a GitHub Release is created, use the following rule: | ||
# if: github.event_name == 'release' && github.event.action == 'published' | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- name: Publish package on PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
verbose: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Build and run test extras | ||
|
||
on: | ||
push: | ||
branches: [ "beta" ] | ||
#pull_requests | ||
# branches: [ "master", "develop", "beta" ] | ||
# Allow running manually from Actions tab | ||
workflow_dispatch: | ||
|
||
env: | ||
SKIP_DEAP: 1 | ||
NOSE_VERBOSE: 2 | ||
NOSE_WITH_TIMER: 1 | ||
NOSE_WITH_ID: 1 | ||
NOSE_REDNOSE: 1 | ||
NOSE_WITH_COVERAGE: 1 | ||
NOSE_COVER_PACKAGE: "pygsti" | ||
NOSE_PROCESSES: -1 | ||
NOSE_NOPATH: "" | ||
NOSE_PROCESS_TIMEOUT: 2400 | ||
NOSE_WHERE: "test/test_packages/" | ||
|
||
jobs: | ||
test_extras: # On stable branches, run extended tests | ||
|
||
runs-on: ubuntu-18.04 | ||
strategy: | ||
fail-fast: false # Finish all tests even if one fails | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
nose-tests: | ||
- "algorithms algorithmsb" | ||
- "report reportb" | ||
- "drivers objects tools iotest optimize construction extras" | ||
# - "mpi" # Fails in GitHub Actions, passes locally but doesn't terminate threads properly | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up installation environment | ||
run: | | ||
./.github/ci-scripts/before_install.sh | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Cache pip packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ hashFiles('**/*requirements.txt') }} | ||
- name: Install package | ||
run: | | ||
python -m pip install --upgrade pip | ||
# Installing with -e to keep installation local (for NOSE_NOPATH) | ||
# but still compile Cython extensions | ||
python -m pip install -e .[testing] | ||
- name: Run test_packages ${{ matrix.nose-tests }} | ||
env: | ||
NOSETESTS: ${{ matrix.nose-tests }} | ||
run: | | ||
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)" | ||
echo "nosetests: $NOSETESTS" | ||
nosetests $NOSETESTS | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Build and run tests | ||
|
||
on: | ||
push: | ||
branches-ignore: [ "beta" ] | ||
# Hacky way to only run pull requests from forked repositories (assumes : is not used in branch names unless forked) | ||
# https://github.community/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/16662/10 | ||
pull_request: | ||
branches: [ "**:**" ] | ||
# Allow running manually from Actions tab | ||
workflow_dispatch: | ||
|
||
env: | ||
SKIP_DEAP: 1 | ||
NOSE_VERBOSE: 2 | ||
NOSE_WITH_TIMER: 1 | ||
NOSE_WITH_ID: 1 | ||
NOSE_REDNOSE: 1 | ||
NOSE_WITH_COVERAGE: 1 | ||
NOSE_COVER_PACKAGE: "pygsti" | ||
NOSE_PROCESSES: -1 | ||
NOSE_NOPATH: 1 # use installed package, not source tree under CWD | ||
NOSE_PROCESS_TIMEOUT: 2400 | ||
NOSE_WHERE: "test/unit/" | ||
|
||
jobs: | ||
build: # Main build + unit test check | ||
|
||
runs-on: ubuntu-18.04 | ||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up installation environment | ||
run: | | ||
./.github/ci-scripts/before_install.sh | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Cache pip packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-${{ hashFiles('**/*requirements.txt') }} | ||
- name: Install package | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install flake8 | ||
python -m pip install .[testing] | ||
# python -m pip freeze # this isn't relevant anymore since pip install builds a wheel separately | ||
- name: Lint with flake8 | ||
run: | | ||
# Critical errors, exit on failure | ||
flake8 . --count --show-source --statistics --config=.flake8-critical | ||
# Standard PEP8, allowed to fail since exit-zero treats all errors as warnings | ||
flake8 . --exit-zero --statistics | ||
- name: Run unit tests | ||
run: | | ||
python -Ic "import pygsti; print(pygsti.__version__); print(pygsti.__path__)" | ||
echo "nosetests: $NOSETESTS" | ||
nosetests $NOSETESTS | ||
push: # Push to stable "beta" branch on successful build | ||
|
||
runs-on: ubuntu-18.04 | ||
|
||
# Only run on "develop" branch if tests pass | ||
needs: build | ||
if: github.ref == 'refs/heads/develop' && github.event_name == 'push' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.PYGSTI_TOKEN }} | ||
- name: Merge changes to beta branch | ||
run: | | ||
git config --global user.name 'PyGSTi' | ||
git config --global user.email '[email protected]' | ||
git checkout beta | ||
git merge --ff-only ${GITHUB_SHA} && git push origin beta | ||
Oops, something went wrong.