Skip to content

Commit

Permalink
Merge pull request #410 from ProjectQ-Framework/release/0.7.0
Browse files Browse the repository at this point in the history
Release version 0.7.0
  • Loading branch information
Takishima authored Jul 15, 2021
2 parents 1ff10be + 8ef487d commit db4a088
Show file tree
Hide file tree
Showing 216 changed files with 3,316 additions and 2,624 deletions.
82 changes: 43 additions & 39 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: "Publish new release"

on:
workflow_dispatch:
push:
tags:
- v[0-9]+.*
Expand All @@ -14,78 +15,59 @@ jobs:
packaging:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
if: startsWith(github.ref, 'refs/tags/') || (github.event_name == 'pull_request' && github.event.pull_request.merged == true)
if: startsWith(github.ref, 'refs/tags/') || (github.event_name == 'pull_request' && github.event.pull_request.merged == true) || github.event_name == 'workflow_dispatch'
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-10.15]
os:
- ubuntu-latest

steps:
- uses: actions/checkout@v2
if: github.event_name != 'workflow_dispatch'

- uses: actions/checkout@v2
if: github.event_name == 'workflow_dispatch'
with:
ref: 'master'

- name: Get history and tags for SCM versioning to work
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Extract version from tag name (Unix)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && runner.os != 'Windows'
run: |
TAG_NAME="${GITHUB_REF/refs\/tags\//}"
VERSION=${TAG_NAME#v}
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
# ========================================================================

- name: Extract version from branch name (for release branches) (Unix)
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/') && runner.os != 'Windows'
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#release/}
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
git tag v${RELEASE_VERSION} master
git tag v${VERSION} master
- name: Extract version from branch name (for hotfix branches) (Unix)
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'hotfix/') && runner.os != 'Windows'
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#hotfix/}
git tag v${VERSION} master
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
git tag v${RELEASE_VERSION} master
- name: Extract version from tag name (Windows)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && runner.os == 'Windows'
run: |
$TAG_NAME = $GITHUB_REF -replace "refs/tags/",""
$VERSION = $TAG_NAME -replace "v",""
Write-Output "RELEASE_VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# ------------------------------------------------------------------------

- name: Extract version from branch name (for release branches) (Windows)
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/') && runner.os == 'Windows'
run: |
$BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
$VERSION = $BRANCH_NAME -replace "release/",""
git tag v${VERSION} master
Write-Output "RELEASE_VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
git tag v${RELEASE_VERSION} master
- name: Extract version from branch name (for hotfix branches) (Unix)
- name: Extract version from branch name (for hotfix branches) (Windows)
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'hotfix/') && runner.os == 'Windows'
run: |
$BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
$VERSION = $BRANCH_NAME -replace "hotfix/",""
git tag v${VERSION} master
Write-Output "RELEASE_VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
git tag v${RELEASE_VERSION} master
- name: Build wheels
uses: joerick/[email protected]
env:
CIBW_ARCHS: auto64
CIBW_SKIP: cp27-* pp* cp35-*
CIBW_BEFORE_BUILD: python -m pip install pybind11
# ========================================================================

- name: Build source distribution
if: runner.os == 'Linux'
Expand All @@ -101,11 +83,21 @@ jobs:
name: packages
path: ./wheelhouse/*


release:
name: Publish new release
runs-on: ubuntu-latest
needs: packaging
needs:
- packaging
steps:
- name: Extract version from tag name (workflow_dispatch)
if: github.event_name == 'workflow_dispatch'
run: |
TAG_NAME=$(git describe --tags `git rev-list --tags --max-count=1`)
VERSION=${TAG_NAME#v}
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
- name: Extract version from tag name
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
run: |
Expand All @@ -130,8 +122,18 @@ jobs:
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
# ------------------------------------------------------------------------
# Checkout repository to get CHANGELOG

- uses: actions/checkout@v2
if: github.event_name != 'workflow_dispatch'

- uses: actions/checkout@v2
if: github.event_name == 'workflow_dispatch'
with:
ref: 'master'

# ------------------------------------------------------------------------
# Downloads all to directories matching the artifact names
- uses: actions/download-artifact@v2

Expand Down Expand Up @@ -164,7 +166,7 @@ jobs:
upload_to_pypi:
name: Upload to PyPI
runs-on: ubuntu-latest
needs: release # Only upload to PyPi if everything was successful
needs: release
steps:
- uses: actions/setup-python@v2

Expand All @@ -181,7 +183,9 @@ jobs:
master_to_develop_pr:
name: Merge master back into develop
runs-on: ubuntu-latest
needs: release # Only create PR if everything was successful
needs:
- release
- upload_to_pypi
steps:
- name: Merge master into develop branch
uses: thomaseizinger/[email protected]
Expand Down
111 changes: 66 additions & 45 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,56 +12,77 @@
#
# See https://github.com/pre-commit/pre-commit

---

ci:
skip: [check-manifest]
skip: [check-manifest]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: check-toml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- id: fix-encoding-pragma
- repo: meta
hooks:
- id: check-useless-excludes

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: check-toml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- id: fix-encoding-pragma

# Changes tabs to spaces
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.10
hooks:
- id: remove-tabs

# Changes tabs to spaces
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.10
hooks:
- id: remove-tabs
- repo: https://github.com/PyCQA/isort
rev: 5.9.1
hooks:
- id: isort
name: isort (python)

- repo: https://github.com/psf/black
rev: 21.5b1
hooks:
- id: black
language_version: python3
# This is a slow hook, so only run this if --hook-stage manual is passed
stages: [manual]
- repo: https://github.com/psf/black
rev: 21.5b1
hooks:
- id: black
language_version: python3
# This is a slow hook, so only run this if --hook-stage manual is passed
stages: [manual]

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
exclude: ^(docs/.*|tools/.*)$
- repo: https://gitlab.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
name: flake8-strict
exclude: ^(.*_test\.py)$
additional_dependencies: [flake8-comprehensions, flake8-breakpoint,
flake8-eradicate, flake8-mutable,
flake8-docstrings]
- id: flake8
name: flake8-test-files
additional_dependencies: [flake8-comprehensions, flake8-breakpoint,
flake8-eradicate, flake8-mutable]
files: ^(.*_test\.py)$

- repo: https://github.com/pre-commit/mirrors-pylint
rev: 'v3.0.0a3'
hooks:
- id: pylint
args: ['--score=n']
# This is a slow hook, so only run this if --hook-stage manual is passed
stages: [manual]
additional_dependencies: ['pybind11>=2.6', 'numpy', 'requests', 'boto3', 'matplotlib', 'networkx']
- repo: https://github.com/pre-commit/mirrors-pylint
rev: 'v3.0.0a3'
hooks:
- id: pylint
args: ['--score=n']
# This is a slow hook, so only run this if --hook-stage manual is passed
stages: [manual]
additional_dependencies: [pybind11>=2.6, numpy, requests, boto3, matplotlib, networkx, sympy]

- repo: https://github.com/mgedmin/check-manifest
rev: "0.46"
hooks:
- id: check-manifest
additional_dependencies: ['setuptools-scm', 'pybind11>=2.6']
- repo: https://github.com/mgedmin/check-manifest
rev: '0.46'
hooks:
- id: check-manifest
additional_dependencies: ['setuptools-scm', 'pybind11>=2.6']
49 changes: 47 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
### Repository

## [0.7.0] - 2021-07-14

### Added

- UnitarySimulator backend for computing the unitary transformation corresponding to a quantum circuit

### Changed

- Moved some exceptions classes into their own files to avoid code duplication

### Deprecated

### Fixed

- Prevent infinite recursion errors when too many compiler engines are added to the MainEngine
- Error in testing the decomposition for the phase estimation gate
- Fixed small issue with matplotlib drawing backend
- Make all docstrings PEP257 compliant

### Removed

- Some compatibility code for Python 2.x

### Repository

- Added `isort` to the list of pre-commit hooks
- Added some more flake8 plugins to the list used by `pre-commit`:
+ flake8-breakpoint
+ flake8-comprehensions
+ flake8-docstrings
+ flake8-eradicate
+ flake8-mutable

## [0.6.1] - 2021-06-23

### Repository
Expand Down Expand Up @@ -51,17 +84,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Repository

- Use `setuptools-scm` for versioning

- Added `.editorconfig` file

- Added `pyproject.toml` and `setup.cfg`

- Added CHANGELOG.md

- Added support for GitHub Actions
- Build and testing on various plaforms and compilers
- Automatic draft of new release
- Automatic publication of new release once ready
- Automatic upload of releases artifacts to PyPi and GitHub

- Added pre-commit configuration file

- Updated cibuildwheels action to v1.11.1

- Updated thomaseizinger/create-pull-request action to v1.1.0

## [0.5.1] - 2019-02-15
Expand Down Expand Up @@ -102,6 +141,12 @@ The ProjectQ v0.5.x release branch is the last one that is guaranteed to work wi

Future releases might introduce changes that will require Python 3.5 (Python 3.4 and earlier have already been declared deprecated at the time of this writing)

[Unreleased]: https://github.com/ProjectQ-Framework/ProjectQ/compare/0.6.0...HEAD
[Unreleased]: https://github.com/ProjectQ-Framework/ProjectQ/compare/v0.7.0...HEAD

[0.7.0]: https://github.com/ProjectQ-Framework/ProjectQ/compare/v0.6.1...v0.7.0

[0.6.0]: https://github.com/ProjectQ-Framework/ProjectQ/compare/v0.5.1...v0.6.0

[0.5.1]: https://github.com/ProjectQ-Framework/ProjectQ/compare/v0.5.0...v0.5.1

[0.6.0]: https://github.com/ProjectQ-Framework/ProjectQ/compare/0.5.1...0.6.0
[0.5.0]: https://github.com/ProjectQ-Framework/ProjectQ/compare/v0.4.2...v0.5.0
Loading

0 comments on commit db4a088

Please sign in to comment.