Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub actions, pre-commit hooks, pyproject.toml and more #395

Merged
merged 37 commits into from
Jun 14, 2021

Conversation

Takishima
Copy link
Collaborator

@Takishima Takishima commented May 12, 2021

Summary of changes

  • Add support for GitHub actions (in replacement of Travis CI)
  • Add configuration file for dependabot
  • Add support for pre-commit Git hooks
  • Use setuptools-scm for automatic versioning based on GitHub tags
  • Add setup.cfg configuration file and move package metadata from setup.py
  • Add pyproject.toml configuration file
  • Add .editorconfig file
  • Add CHANGELOG.md file

README for the reviewer

Since this is a PR with a quite large change-set, you can probably best review this PR in chunks (below are commit ranges):

  • First 6 commits (da29a79..50a574f): most of the fundamental changes brought by this PR are located here
  • Last 7 commits (d3ba306..df805dd): this is where the rest of the fundamental changes are
  • Rest of the commits (752d633..ed063bb): changes to address the issues due to the new building and testing by the GitHub CI (ie. quasi no changes in functionality for ProjectQ just taking care of warnings from flake8, etc.)

GitHub Actions

Add support for GitHub actions (in replacement of Travis CI) for testing, linting and building binaries. ProjectQ now has 3 distinct pipelines:

  • CI : dedicated to testing the building and installation of ProjectQ on multiple systems and compilers
  • Format: run a series of pre-commit hooks, static analysis and linting tools such as pylint, flake8, clang-tidy, etc.
  • PR: execute a few checks on each PR. For now mostly make sure that the PR modifies the CHANGELOG.md file.
  • Draft release: Draft a new release on GitHub (create release branch, create PR, update changelog, etc.)
  • Publish release: Create a new release on GitHub, build binary wheels, upload the wheels to GitHub and PyPi

Caveat

The move to GitHub Action and some of the others mentioned above means that this will most likely break the installation of ProjectQ with Python 3.5 or lower (and definitely break compatibility with Python 2.x). Compatibility with Python 3.5.x is still probably possible by lightly editing some configuration file (e.g. probably remove any mention of setuptools-scm in setup.py and pyproject.toml for regaining Python 3.5 compatibility).

Support pre-commit Git hooks

Added .pre-commit-config.yaml YAML configuration file for pre-commit to allow an easier time running a set of pre-commit hooks such as:

  • A few of GitHub's pre-commit hooks
  • check-manifest
  • remove-tabs
  • black
  • flake8
  • pylint

@Takishima Takishima changed the title Test GitHub actions, pre-commit hooks, pyproject.toml and more May 12, 2021
@Takishima Takishima self-assigned this May 12, 2021
Copy link
Collaborator

@andreashehn andreashehn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. I've got some questions and change requests fixing formatting.

projectq/backends/_awsbraket/_awsbraket_boto3_client.py Outdated Show resolved Hide resolved
projectq/backends/_awsbraket/_awsbraket_boto3_client.py Outdated Show resolved Hide resolved
projectq/backends/_circuits/_drawer.py Outdated Show resolved Hide resolved
projectq/backends/_circuits/_drawer.py Outdated Show resolved Hide resolved
projectq/backends/_circuits/_drawer_matplotlib.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
setup.cfg Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
@Takishima
Copy link
Collaborator Author

Thanks for the review! I have made the required changes in the code and marked those conversations as "resolved". For your questions, I will let you mark them as resolved once you are satisfied with my answers ;-)

projectq/meta/_compute.py Outdated Show resolved Hide resolved
@Takishima
Copy link
Collaborator Author

Ok, I think I have not managed to fix everything that was broken (somehow the CI builds that worked previously for Clang and GCC started to fail?!) and address the bug in the classical simulator.

If you're happy with those changes, then I will merge this in the coming days. Thanks again for your contribution and doing this review.

@Takishima Takishima merged commit 23dac9e into develop Jun 14, 2021
@Takishima
Copy link
Collaborator Author

Thanks a lot for you review @andreashehn !

@Takishima Takishima deleted the feature/github-actions branch June 14, 2021 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants