Skip to content

Latest commit

 

History

History
64 lines (46 loc) · 3.13 KB

CONTRIBUTING.md

File metadata and controls

64 lines (46 loc) · 3.13 KB

code style: black docs style: NumPy commit style: Conventional Commits

Poetry pre-commit

Contributing

Install

To contribute to this project you will need to install poetry, fork this repo, and clone your copy locally. Then run:

$ poetry install  [--extras "$COMMA_SEPARATED_EXTRAS"]

Notice that specific platforms are not installed automatically. You can specify which ones to install through the extras tag (e.g. qiskit, cirq, qsharp).

The resulting virtual environment with all the dependencies is activated as usual. If located inside the repo (i.e. poetry config virtualenvs.in-project true before poetry install):

$ source .venv/bin/activate

Alternatively this one-liner is available:

source `poetry env info --path`/bin/activate

Finally, git hooks are available via:

(.venv) $ pre-commit install  # Install pre-commit hooks
pre-commit installed at .git/hooks/pre-commit
(.venv) $ pre-commit install --hook-type commit-msg # Install commit-msg hooks
pre-commit installed at .git/hooks/commit-msg

Documentation

For this project we adhere to the numpydoc docstring guide. If you make any changes to the code, remember updating the docstring wherever relevant.

Difficulty classes

All issues in this repo are assigned a Difficulty Class (DC) from 1 to 5. These different levels roughly correspond to:

  • DC-1 → Basic knowledge
  • DC-2 → Application/user level knowledge
  • DC-3 → Domain/technology specific knowledge
  • DC-4 → Multidomain knowledge
  • DC-5 → System-wide knowledge

Known issues

MacOS (10-13-2020)

As of October 2020, MacOS Xcode ships with python 3.8.2 specially set up to support future arm64 architectures. This will cause the build process of regex (a dependency of black) to fail, which in turn will cause an error when the pre-commit hooks get executed for the first time (i.e. on git commit). To fix this issue one must create the virtual environment with a compatible version of python before running poetry install (e.g. using homebrew):

$ brew install [email protected]
$ virtualenv .venv -p /usr/local/Cellar/[email protected]/3.9.0/bin/python3.9

This requires virtualenv to be installed beforehand.


(c) 2021 Pedro Rivero