Skip to content

Commit

Permalink
[SDS-982] deletion of projects
Browse files Browse the repository at this point in the history
  • Loading branch information
QFer committed May 9, 2023
1 parent 65994b2 commit 3271c72
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
run: |
python ./docs/examples/example_qiskit_entangle.py
python ./docs/examples/example_qiskit_conditional.py
python ./docs/examples/delete_projects.py
env:
QI_TOKEN: ${{ secrets.QI_TOKEN }}
API_URL: https://api.quantum-inspire.com
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ script:
jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=300 docs/examples/example_projectq.ipynb;
jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=300 docs/examples/grover_algorithm_qi.ipynb;
jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=300 docs/examples/qi-performance-test.ipynb;
python ./docs/examples/delete_projects.py;
fi
after_success:
- coveralls
Expand Down
20 changes: 9 additions & 11 deletions docs/examples/delete_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@
Copyright 2018-2023 QuTech Delft. Licensed under the Apache License, Version 2.0.
"""
import os

from quantuminspire.credentials import get_authentication
from quantuminspire.credentials import get_token_authentication, load_account
from quantuminspire.qiskit import QI

QI_URL = os.getenv('API_URL', 'https://api.quantum-inspire.com/')

authentication = get_authentication()
QI.set_authentication(authentication, QI_URL)
api = QI.get_api()
token = load_account()
if token is not None:
qi_authentication = get_token_authentication(token)
QI.set_authentication(qi_authentication)
api = QI.get_api()

projects = api.get_projects()
for project in projects:
api.delete_project(project["id"])
projects = api.get_projects()
for project in projects:
api.delete_project(project["id"])

0 comments on commit 3271c72

Please sign in to comment.