You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We encourage installing this package via `pip`, when possible.
55
+
56
+
To be useful, this package requires at least one tensor-network backend. The following command installs the [Qiskit Aer](https://github.com/Qiskit/qiskit-aer) backend, as well as the [quimb](https://github.com/jcmgray/quimb) backend with automatic differentiation support from [JAX](https://github.com/jax-ml/jax):
If you use this package in your research, please cite it according to the [CITATION.bib](https://github.com/Qiskit/qiskit-addon-aqc-tensor/blob/main/CITATION.bib) file.
This repository's tests and development automation tasks are organized using [tox], a command-line CI frontend for Python projects. tox is typically used during local development and is also invoked from this repository's GitHub Actions [workflows](../.github/workflows/).
4
+
5
+
tox can be installed by running `pip install tox`.
6
+
7
+
tox is organized around various "environments," each of which is described below. To run _all_ test environments, run `tox` without any arguments:
8
+
9
+
```sh
10
+
$ tox
11
+
```
12
+
13
+
Environments for this repository are configured in [`tox.ini`] as described below.
14
+
15
+
## Lint environment
16
+
17
+
The `lint` environment ensures that the code meets basic coding standards, including
18
+
19
+
-[_Black_] formatting style
20
+
- Style checking with [ruff], [autoflake], and [pydocstyle]
21
+
-[mypy] type annotation checker, as configured by [`.mypy.ini`]
22
+
23
+
The _Black_ and mypy passes are applied also to [Jupyter] notebooks (via [nbqa]).
24
+
25
+
To run:
26
+
27
+
```sh
28
+
$ tox -e lint
29
+
```
30
+
31
+
## Style environment
32
+
33
+
The command `tox -e style` will apply automated style fixes. This includes:
34
+
35
+
- Automated fixes from [ruff] and [autoflake]
36
+
- Reformatting of all files in the repository according to _Black_ style
37
+
38
+
## Test (py##) environments
39
+
40
+
The `py##` environments are the main test environments. tox defines one for each version of Python. For instance, the following command will run the tests on Python 3.10, Python 3.11, and Python 3.12:
41
+
42
+
```sh
43
+
$ tox -e py310,py311,py312
44
+
```
45
+
46
+
These environments execute all tests using [pytest], which supports its own simple style of tests, in addition to [unittest]-style tests.
47
+
48
+
## Notebook environments
49
+
50
+
The `notebook` and `py##-notebook` environments invoke [nbmake] to ensure that all Jupyter notebooks in the [`docs/`](/docs/) directory execute successfully.
51
+
52
+
```sh
53
+
$ tox -e py310-notebook
54
+
```
55
+
56
+
## Doctest environments
57
+
58
+
The `doctest` environments use [doctest] to execute the code snippets that are embedded into the documentation strings. The tests get run using [pytest].
59
+
60
+
```sh
61
+
$ tox -e py310-doctest
62
+
```
63
+
64
+
## Coverage environment
65
+
66
+
The `coverage` environment uses [Coverage.py] to ensure that the fraction of code tested by pytest is above some threshold (enforced to be 100% for new modules). A detailed, line-by-line coverage report can be viewed by navigating to `htmlcov/index.html` in a web browser.
67
+
68
+
To run:
69
+
70
+
```sh
71
+
$ tox -e coverage
72
+
```
73
+
74
+
## Documentation environment
75
+
76
+
The `docs` environment builds the [Sphinx] documentation locally.
77
+
78
+
For the documentation build to succeed, [pandoc](https://pandoc.org/) must be installed. Pandoc is not available via pip, so must be installed through some other means. Linux users are encouraged to install it through their package manager (e.g., `sudo apt-get install -y pandoc`), while macOS users are encouraged to install it via [Homebrew](https://brew.sh/) (`brew install pandoc`). Full instructions are available on [pandoc's installation page](https://pandoc.org/installing.html).
79
+
80
+
To run this environment:
81
+
82
+
```sh
83
+
$ tox -e docs
84
+
```
85
+
86
+
If the build succeeds, it can be viewed by navigating to `docs/_build/html/index.html` in a web browser.
0 commit comments