Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 26 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,32 @@ jobs:
key: ${{ runner.os }}-${{ matrix.python }}-pip-${{ hashFiles('**/setup.cfg') }}
restore-keys: ${{ runner.os }}-${{ matrix.python }}-pip-

- name: Generate requirement file (Unix)
if: runner.os != 'Windows'
run: |
python setup.py gen_reqfile --include-extras=test,braket,revkit

- name: Generate requirement file (Windows)
if: runner.os == 'Windows'
run: |
python setup.py gen_reqfile --include-extras=test,braket

- name: Prepare env
run: |
python setup.py gen_reqfile --include-extras
python -m pip install -r requirements.txt --prefer-binary
python -m pip install -r requirements_tests.txt --prefer-binary
python -m pip install coveralls

- name: Setup annotations on Linux
if: runner.os == 'Linux'
run: python -m pip install pytest-github-actions-annotate-failures

- name: Build and install package
run: python -m pip install -ve .[braket]
- name: Build and install package (Unix)
if: runner.os != 'Windows'
run: python -m pip install -ve .[braket,revkit,test]

- name: Build and install package (Windows)
if: runner.os == 'Windows'
run: python -m pip install -ve .[braket,test]

- name: Pytest
run: |
Expand Down Expand Up @@ -125,15 +138,14 @@ jobs:

- name: Prepare Python env
run: |
python3 setup.py gen_reqfile --include-extras
python3 setup.py gen_reqfile --include-extras=test,braket
python3 -m pip install -r requirements.txt --prefer-binary
python3 -m pip install -r requirements_tests.txt --prefer-binary

- name: Upgrade pybind11 and flaky
run: python3 -m pip install --upgrade pybind11 flaky --prefer-binary

- name: Build and install package
run: python3 -m pip install -ve .[braket]
run: python3 -m pip install -ve .[braket,test]

- name: Pytest
run: |
Expand Down Expand Up @@ -170,15 +182,14 @@ jobs:

- name: Prepare Python env
run: |
python3 setup.py gen_reqfile --include-extras
python3 setup.py gen_reqfile --include-extras=test,braket
python3 -m pip install -r requirements.txt --prefer-binary
python3 -m pip install -r requirements_tests.txt --prefer-binary

- name: Upgrade pybind11 and flaky
run: python3 -m pip install --upgrade pybind11 flaky --prefer-binary

- name: Build and install package
run: python3 -m pip install -ve .[braket]
run: python3 -m pip install -ve .[braket,test]

- name: Pytest
run: |
Expand Down Expand Up @@ -244,12 +255,11 @@ jobs:

- name: Install dependencies
run: |
python3 setup.py gen_reqfile --include-extras
python3 setup.py gen_reqfile --include-extras=test,braket
python3 -m pip install -r requirements.txt --prefer-binary
python3 -m pip install -r requirements_tests.txt --prefer-binary

- name: Build and install package
run: python3 -m pip install -ve .[braket]
run: python3 -m pip install -ve .[braket,test]

- name: Pytest
run: |
Expand Down Expand Up @@ -283,10 +293,7 @@ jobs:

- name: Install docs & setup requirements
run: |
python3 setup.py gen_reqfile --include-extras
python3 -m pip install -r requirements.txt --prefer-binary
python3 -m pip install -r docs/requirements.txt --prefer-binary
python3 -m pip install .
python3 -m pip install .[docs]

- name: Build docs
run: python3 -m sphinx -b html docs docs/.build
Expand Down Expand Up @@ -334,12 +341,11 @@ jobs:

- name: Prepare env
run: |
python setup.py gen_reqfile --include-extras
python setup.py gen_reqfile --include-extras=test,braket
python -m pip install -r requirements.txt --prefer-binary
python -m pip install -r requirements_tests.txt --prefer-binary

- name: Build and install package
run: python -m pip install -ve .[braket]
run: python -m pip install -ve .[braket,test]

- name: Run all checks
run: |
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,59 @@ jobs:
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

- 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/}

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/",""

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)
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/",""

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/cibuildwheel@v1.11.1
env:
Expand Down
19 changes: 11 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#
# See https://github.com/pre-commit/pre-commit

ci:
skip: [check-manifest]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
Expand All @@ -25,7 +28,6 @@ repos:
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: trailing-whitespace
- id: fix-encoding-pragma

Expand All @@ -35,12 +37,6 @@ repos:
hooks:
- id: remove-tabs

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
exclude: ^(docs/.*|tools/.*)$

- repo: https://github.com/psf/black
rev: 21.5b1
hooks:
Expand All @@ -49,13 +45,20 @@ repos:
# 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://github.com/pre-commit/mirrors-pylint
rev: 'v3.0.0a3'
hooks:
- id: pylint
args: ['--score=n', '--exit-zero']
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/mgedmin/check-manifest
rev: "0.46"
Expand Down
19 changes: 19 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

sphinx:
configuration: docs/conf.py

formats: all

python:
version: 3.8
install:
- method: pip
path: .
extra_requirements:
- docs
62 changes: 48 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,61 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
### Changed
### Deprecated
### Fixed
### Removed
### Repository

## [0.6.1] - 2021-06-23

- 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
- Use ``setuptools-scm`` for versioning
- Added ``.editorconfig` file
- Added ``pyproject.toml`` and ``setup.cfg``
- Added CHANGELOG.md
- Added backend for IonQ.
- Added support for state-dependent qubit control
### Repository

- Fix GitHub workflow for publishing a new release

## [0.6.0] - 2021-06-23

### Added

- New backend for the IonQ platform
- New backend for the AWS Braket platform
- New gates for quantum math operations on quantum registers
- Support for state-dependent control qubits (ie. negatively or positively controlled gates)

### Changed

- Name of the single parameter of the `LocalOptimizer` has been changed from `m` to `cache_size` in order to better represent its actual use.

### Deprecated

- Compatibility with Python <= 3.5
- Compatibility with Python &lt;= 3.5
- `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.

### Fixed

- Installation on Mac OS Big Sur
- IBM Backend issues with new API

### Removed

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

### Repository

- Updated cibuildwheels action to v1.11.1
- Updated thomaseizinger/create-pull-request action to v1.1.0
- 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 @@ -71,3 +101,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
The ProjectQ v0.5.x release branch is the last one that is guaranteed to work with Python 2.7.x.

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

[0.6.0]: https://github.com/ProjectQ-Framework/ProjectQ/compare/0.5.1...0.6.0
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ include CHANGELOG.md
include MANIFEST.in
include NOTICE
include README.rst
include requirements*.txt
include setup.py
include setup.cfg
include pyproject.toml
Expand Down
23 changes: 13 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
ProjectQ - An open source software framework for quantum computing
==================================================================

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

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

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

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

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


ProjectQ is an open source effort for quantum computing.
Expand Down
5 changes: 2 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
Expand All @@ -18,7 +16,8 @@
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# pylint: skip-file

import os
import sys

Expand Down
Loading