Skip to content

Commit

Permalink
build: merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoLiegiBastonLiegi committed Apr 19, 2024
2 parents db2cf73 + d1fee5e commit 048c82b
Show file tree
Hide file tree
Showing 13 changed files with 762 additions and 34 deletions.
9 changes: 9 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi

nix_direnv_watch_file flake.nix
nix_direnv_watch_file flake.lock
if ! use flake . --impure; then
echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2
fi
22 changes: 0 additions & 22 deletions .github/worflows/unit_test.yml

This file was deleted.

File renamed without changes.
File renamed without changes.
68 changes: 68 additions & 0 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Tests

on:
workflow_dispatch:
push:
merge_group:
pull_request:
types: [labeled]

env:
IBMQ_TOKEN: ${{ secrets.IBMQ_TOKEN }}
QIBO_CLIENT_TII_TOKEN: ${{ secrets.QIBO_CLIENT_TII_TOKEN }}

jobs:
build:
if: contains(github.event.pull_request.labels.*.name, 'run-workflow') || github.event_name == 'push'
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.9, "3.10", "3.11"]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install and configure poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Disable modern installer
run: poetry config installer.modern-installation false
- name: Load cached venv
id: cached-pip-wheels
uses: actions/cache@v3
with:
path: ~/.cache
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-interaction --no-root
if: steps.cache.outputs.cache-hit != 'true'
- name: Install project
run: poetry install --no-interaction --with test
- name: Install task runner
run: pip install poethepoet
- name: Lint
run: |
source $VENV
poe lint
poe lint-warnings
- name: Test
run: |
source $VENV
poe test
- name: Upload coverage to Codecov
if: startsWith(runner.os, 'Linux')
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
flags: unittests
name: unit-tests
fail_ci_if_error: true
token: ${{ secrets.codecov_token }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,4 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.devenv
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ Install first the package dependencies with the following commands.
We recommend to start with a fresh virtual environment to avoid dependencies
conflicts with previously installed packages.

``` bash
```bash
$ python -m venv ./env
source activate ./env/bin/activate
```

The qibo-client-backends package can be installed through pip:

``` bash
```bash
pip install qibo-cloud-backends
```

Expand All @@ -29,7 +29,7 @@ received after registration.

Prepare a QFT circuit to be submitted to the servers:

``` python
```python
from qibo.models import QFT
from qibo import gates

Expand All @@ -39,7 +39,7 @@ Prepare a QFT circuit to be submitted to the servers:

Then, to simulate the circuit on the `TII` cluster through the `sim` platform:

``` python
```python

from qibo.backends import set_backend

Expand All @@ -50,7 +50,7 @@ Then, to simulate the circuit on the `TII` cluster through the `sim` platform:

or, in order to use the `ibmq_qasm_simulator` platform on the IBM `ibm-q` server:

``` python
```python

set_backend("qiskit", token="your_token", provider="ibm-q", platform="ibmq_qasm_simulator")
result = circuit()
Expand Down
12 changes: 12 additions & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,15 @@ API Reference
:caption: Contents:

backends

.. toctree::
:maxdepth: 1
:caption: Documentation links

Qibo docs <https://qibo.science/qibo/stable/>
Qibolab docs <https://qibo.science/qibolab/stable/>
Qibocal docs <https://qibo.science/qibocal/stable/>
Qibosoq docs <https://qibo.science/qibosoq/stable/>
Qibochem docs <https://qibo.science/qibochem/stable/>
Qibotn docs <https://qibo.science/qibotn/stable/>
Qibo-cloud-backends docs <https://qibo.science/qibo-cloud-backends/stable/>
Loading

0 comments on commit 048c82b

Please sign in to comment.