Skip to content

Commit e0ff304

Browse files
web-flowTakishima
authored andcommitted
Preparing release v0.6.0
- Fix some minor issues prior to releasing + Fixed pyproject.toml sections for pylint + Fixed constant warning messages if braket extra is not installed + Fixed file ignore list for check-manifest + Fixed issue with version in GitHub Actions + Added `setup_require` section to setup.cfg + Added new extra for testing (will eventually replace requirements_tests.txt) + Update pre-commit config to run black before linters + Update badges in README + Update configuration for pylint and pytest in pyproject.toml + Restructure and update CHANGELOG - Enable pylint in pre-commit hooks - Apply changes based on running pylint - Rename `m` parameter of the LocalOptimizer to `cache_size` - Gracious exit in case of failure in the MainEngine constructor - Remove requirements_tests.txt and improve gen_reqfile setup command - Remove docs/requirements.txt and add .readthedocs.yaml - Remove all assert statements in non-test code - Reinstate flaky test for phase estimation decomposition
1 parent f93cca3 commit e0ff304

166 files changed

Lines changed: 2978 additions & 2714 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,32 @@ jobs:
5050
key: ${{ runner.os }}-${{ matrix.python }}-pip-${{ hashFiles('**/setup.cfg') }}
5151
restore-keys: ${{ runner.os }}-${{ matrix.python }}-pip-
5252

53+
- name: Generate requirement file (Unix)
54+
if: runner.os != 'Windows'
55+
run: |
56+
python setup.py gen_reqfile --include-extras=test,braket,revkit
57+
58+
- name: Generate requirement file (Windows)
59+
if: runner.os == 'Windows'
60+
run: |
61+
python setup.py gen_reqfile --include-extras=test,braket
62+
5363
- name: Prepare env
5464
run: |
55-
python setup.py gen_reqfile --include-extras
5665
python -m pip install -r requirements.txt --prefer-binary
57-
python -m pip install -r requirements_tests.txt --prefer-binary
5866
python -m pip install coveralls
5967
6068
- name: Setup annotations on Linux
6169
if: runner.os == 'Linux'
6270
run: python -m pip install pytest-github-actions-annotate-failures
6371

64-
- name: Build and install package
65-
run: python -m pip install -ve .[braket]
72+
- name: Build and install package (Unix)
73+
if: runner.os != 'Windows'
74+
run: python -m pip install -ve .[braket,revkit,test]
75+
76+
- name: Build and install package (Windows)
77+
if: runner.os == 'Windows'
78+
run: python -m pip install -ve .[braket,test]
6679

6780
- name: Pytest
6881
run: |
@@ -125,15 +138,14 @@ jobs:
125138
126139
- name: Prepare Python env
127140
run: |
128-
python3 setup.py gen_reqfile --include-extras
141+
python3 setup.py gen_reqfile --include-extras=test,braket
129142
python3 -m pip install -r requirements.txt --prefer-binary
130-
python3 -m pip install -r requirements_tests.txt --prefer-binary
131143
132144
- name: Upgrade pybind11 and flaky
133145
run: python3 -m pip install --upgrade pybind11 flaky --prefer-binary
134146

135147
- name: Build and install package
136-
run: python3 -m pip install -ve .[braket]
148+
run: python3 -m pip install -ve .[braket,test]
137149

138150
- name: Pytest
139151
run: |
@@ -170,15 +182,14 @@ jobs:
170182
171183
- name: Prepare Python env
172184
run: |
173-
python3 setup.py gen_reqfile --include-extras
185+
python3 setup.py gen_reqfile --include-extras=test,braket
174186
python3 -m pip install -r requirements.txt --prefer-binary
175-
python3 -m pip install -r requirements_tests.txt --prefer-binary
176187
177188
- name: Upgrade pybind11 and flaky
178189
run: python3 -m pip install --upgrade pybind11 flaky --prefer-binary
179190

180191
- name: Build and install package
181-
run: python3 -m pip install -ve .[braket]
192+
run: python3 -m pip install -ve .[braket,test]
182193

183194
- name: Pytest
184195
run: |
@@ -244,12 +255,11 @@ jobs:
244255

245256
- name: Install dependencies
246257
run: |
247-
python3 setup.py gen_reqfile --include-extras
258+
python3 setup.py gen_reqfile --include-extras=test,braket
248259
python3 -m pip install -r requirements.txt --prefer-binary
249-
python3 -m pip install -r requirements_tests.txt --prefer-binary
250260
251261
- name: Build and install package
252-
run: python3 -m pip install -ve .[braket]
262+
run: python3 -m pip install -ve .[braket,test]
253263

254264
- name: Pytest
255265
run: |
@@ -283,10 +293,7 @@ jobs:
283293

284294
- name: Install docs & setup requirements
285295
run: |
286-
python3 setup.py gen_reqfile --include-extras
287-
python3 -m pip install -r requirements.txt --prefer-binary
288-
python3 -m pip install -r docs/requirements.txt --prefer-binary
289-
python3 -m pip install .
296+
python3 -m pip install .[docs]
290297
291298
- name: Build docs
292299
run: python3 -m sphinx -b html docs docs/.build
@@ -334,12 +341,11 @@ jobs:
334341

335342
- name: Prepare env
336343
run: |
337-
python setup.py gen_reqfile --include-extras
344+
python setup.py gen_reqfile --include-extras=test,braket
338345
python -m pip install -r requirements.txt --prefer-binary
339-
python -m pip install -r requirements_tests.txt --prefer-binary
340346
341347
- name: Build and install package
342-
run: python -m pip install -ve .[braket]
348+
run: python -m pip install -ve .[braket,test]
343349

344350
- name: Run all checks
345351
run: |

.github/workflows/publish_release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,33 @@ jobs:
2727
git fetch --prune --unshallow
2828
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
2929
30+
- name: Extract version from tag name
31+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
32+
run: |
33+
TAG_NAME="${GITHUB_REF/refs\/tags\//}"
34+
VERSION=${TAG_NAME#v}
35+
36+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
37+
38+
- name: Extract version from branch name (for release branches)
39+
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/')
40+
run: |
41+
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
42+
VERSION=${BRANCH_NAME#release/}
43+
44+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
45+
46+
- name: Extract version from branch name (for hotfix branches)
47+
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'hotfix/')
48+
run: |
49+
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
50+
VERSION=${BRANCH_NAME#hotfix/}
51+
52+
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
53+
54+
- name: Set tag for setuptools-scm
55+
run: git tag v${RELEASE_VERSION} master
56+
3057
- name: Build wheels
3158
uses: joerick/cibuildwheel@v1.11.1
3259
env:

.pre-commit-config.yaml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
#
1313
# See https://github.com/pre-commit/pre-commit
1414

15+
ci:
16+
skip: [check-manifest]
17+
1518
repos:
1619
- repo: https://github.com/pre-commit/pre-commit-hooks
1720
rev: v4.0.1
@@ -25,7 +28,6 @@ repos:
2528
- id: debug-statements
2629
- id: end-of-file-fixer
2730
- id: mixed-line-ending
28-
- id: requirements-txt-fixer
2931
- id: trailing-whitespace
3032
- id: fix-encoding-pragma
3133

@@ -35,12 +37,6 @@ repos:
3537
hooks:
3638
- id: remove-tabs
3739

38-
- repo: https://gitlab.com/pycqa/flake8
39-
rev: 3.9.2
40-
hooks:
41-
- id: flake8
42-
exclude: ^(docs/.*|tools/.*)$
43-
4440
- repo: https://github.com/psf/black
4541
rev: 21.5b1
4642
hooks:
@@ -49,13 +45,20 @@ repos:
4945
# This is a slow hook, so only run this if --hook-stage manual is passed
5046
stages: [manual]
5147

48+
- repo: https://gitlab.com/pycqa/flake8
49+
rev: 3.9.2
50+
hooks:
51+
- id: flake8
52+
exclude: ^(docs/.*|tools/.*)$
53+
5254
- repo: https://github.com/pre-commit/mirrors-pylint
5355
rev: 'v3.0.0a3'
5456
hooks:
5557
- id: pylint
56-
args: ['--score=n', '--exit-zero']
58+
args: ['--score=n']
5759
# This is a slow hook, so only run this if --hook-stage manual is passed
5860
stages: [manual]
61+
additional_dependencies: ['pybind11>=2.6', 'numpy', 'requests', 'boto3', 'matplotlib', 'networkx']
5962

6063
- repo: https://github.com/mgedmin/check-manifest
6164
rev: "0.46"

.readthedocs.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
sphinx:
9+
configuration: docs/conf.py
10+
11+
formats: all
12+
13+
python:
14+
version: 3.8
15+
install:
16+
- method: pip
17+
path: .
18+
extra_requirements:
19+
- docs

CHANGELOG.md

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,55 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
### Added
11+
### Changed
12+
### Deprecated
13+
### Fixed
14+
### Removed
15+
### Repository
1116

12-
- Support for GitHub Actions
13-
* Build and testing on various plaforms and compilers
14-
* Automatic draft of new release
15-
* Automatic publication of new release once ready
16-
* Automatic upload of releases artifacts to PyPi and GitHub
17-
- Use ``setuptools-scm`` for versioning
18-
- Added ``.editorconfig` file
19-
- Added ``pyproject.toml`` and ``setup.cfg``
20-
- Added CHANGELOG.md
21-
- Added backend for IonQ.
22-
- Added support for state-dependent qubit control
17+
## [0.6.0] - 2021-06-23
18+
19+
### Added
20+
21+
- New backend for the IonQ platform
22+
- New backend for the AWS Braket platform
23+
- New gates for quantum math operations on quantum registers
24+
- Support for state-dependent control qubits (ie. negatively or positively controlled gates)
25+
26+
### Changed
27+
28+
- Name of the single parameter of the `LocalOptimizer` has been changed from `m` to `cache_size` in order to better represent its actual use.
2329

2430
### Deprecated
2531

26-
- Compatibility with Python <= 3.5
32+
- Compatibility with Python &lt;= 3.5
33+
- `LocalOptimizer(m=10)` should be changed into `LocalOptimizer(cache_size=10)`. Using of the old name is still possible, but is deprecated and will be removed in a future version of ProjectQ.
34+
35+
### Fixed
36+
37+
- Installation on Mac OS Big Sur
38+
- IBM Backend issues with new API
2739

2840
### Removed
2941

3042
- Compatibility with Python 2.7
43+
- Support for multi-qubit measurement gates has been dropped; use `All(Measure) | qureg` instead
3144

3245
### Repository
3346

34-
- Updated cibuildwheels action to v1.11.1
35-
- Updated thomaseizinger/create-pull-request action to v1.1.0
47+
- Use `setuptools-scm` for versioning
48+
- Added `.editorconfig` file
49+
- Added `pyproject.toml` and `setup.cfg`
50+
- Added CHANGELOG.md
51+
- Added support for GitHub Actions
52+
- Build and testing on various plaforms and compilers
53+
- Automatic draft of new release
54+
- Automatic publication of new release once ready
55+
- Automatic upload of releases artifacts to PyPi and GitHub
56+
- Added pre-commit configuration file
57+
58+
- Updated cibuildwheels action to v1.11.1
59+
- Updated thomaseizinger/create-pull-request action to v1.1.0
3660

3761
## [0.5.1] - 2019-02-15
3862

@@ -71,3 +95,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7195
The ProjectQ v0.5.x release branch is the last one that is guaranteed to work with Python 2.7.x.
7296

7397
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)
98+
99+
[Unreleased]: https://github.com/ProjectQ-Framework/ProjectQ/compare/0.6.0...HEAD
100+
101+
[0.6.0]: https://github.com/ProjectQ-Framework/ProjectQ/compare/0.5.1...0.6.0

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ include CHANGELOG.md
33
include MANIFEST.in
44
include NOTICE
55
include README.rst
6-
include requirements*.txt
76
include setup.py
87
include setup.cfg
98
include pyproject.toml

README.rst

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
ProjectQ - An open source software framework for quantum computing
22
==================================================================
33

4-
.. image:: https://travis-ci.org/ProjectQ-Framework/ProjectQ.svg?branch=master
5-
:target: https://travis-ci.org/ProjectQ-Framework/ProjectQ
4+
.. image:: https://img.shields.io/pypi/pyversions/projectq?label=Python
5+
:alt: PyPI - Python Version
66

7-
.. image:: https://coveralls.io/repos/github/ProjectQ-Framework/ProjectQ/badge.svg
8-
:target: https://coveralls.io/github/ProjectQ-Framework/ProjectQ
7+
.. image:: https://badge.fury.io/py/projectq.svg
8+
:target: https://badge.fury.io/py/projectq
99

10-
.. image:: https://readthedocs.org/projects/projectq/badge/?version=latest
11-
:target: http://projectq.readthedocs.io/en/latest/?badge=latest
12-
:alt: Documentation Status
10+
.. image:: https://github.com/ProjectQ-Framework/ProjectQ/actions/workflows/ci.yml/badge.svg
11+
:alt: CI Status
12+
:target: https://github.com/ProjectQ-Framework/ProjectQ/actions/workflows/ci.yml
1313

14-
.. image:: https://badge.fury.io/py/projectq.svg
15-
:target: https://badge.fury.io/py/projectq
14+
.. image:: https://coveralls.io/repos/github/ProjectQ-Framework/ProjectQ/badge.svg
15+
:alt: Coverage Status
16+
:target: https://coveralls.io/github/ProjectQ-Framework/ProjectQ
1617

17-
.. image:: https://img.shields.io/badge/python-2.7%2C%203.4%2C%203.5%2C%203.6-brightgreen.svg
18+
.. image:: https://readthedocs.org/projects/projectq/badge/?version=latest
19+
:target: http://projectq.readthedocs.io/en/latest/?badge=latest
20+
:alt: Documentation Status
1821

1922

2023
ProjectQ is an open source effort for quantum computing.

docs/conf.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
#!/usr/bin/env python3
42
# -*- coding: utf-8 -*-
53
#
@@ -18,7 +16,8 @@
1816
# If extensions (or modules to document with autodoc) are in another directory,
1917
# add these directories to sys.path here. If the directory is relative to the
2018
# documentation root, use os.path.abspath to make it absolute, like shown here.
21-
#
19+
# pylint: skip-file
20+
2221
import os
2322
import sys
2423

0 commit comments

Comments
 (0)