Skip to content

Commit

Permalink
Version updates
Browse files Browse the repository at this point in the history
Update some requirements
  • Loading branch information
fretchen authored Feb 10, 2024
2 parents 9458538 + f92a345 commit b02c688
Show file tree
Hide file tree
Showing 11 changed files with 278 additions and 296 deletions.
506 changes: 242 additions & 264 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "django-qlued"
version = "0.1.0"
version = "0.1.1a0"
description = "Django packages that enables validated cloud access to quantum hardware."
authors = ["fretchen <fred.jendrzejewski@gmail.com>"]
license = "Apache-2.0"
Expand All @@ -17,23 +17,23 @@ django-ninja = "^1.1.0"
python-decouple = "^3.8"
pytz = "^2023.3.post1"
whitenoise = "^6.6.0"
sqooler = "^0.4.0"
sqooler = "^0.5.0"


[tool.poetry.group.dev.dependencies]
pylint = "^3.0.3"
black = "^23.12.1"
mypy = "^1.7.0"
pylint-django = "^2.5.5"
django-stubs = {extras = ["compatible-mypy"], version = "^4.2.7"}
django-csp = "^3.7"
black = "^24.1.1"

[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
mike = "^2.0.0"
mkdocs-material = "^9.5.5"
mkdocs-material = "^9.5.7"
mkdocs = "^1.5.3"
mkdocstrings-python = "^1.8.0"

Expand Down
36 changes: 18 additions & 18 deletions src/qlued/api_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ def post_job(request, data: JobSchemaWithTokenIn, backend_name: str):
except json.decoder.JSONDecodeError:
job_response_dict["status"] = "ERROR"
job_response_dict["detail"] = "The encoding of your json seems not work out!"
job_response_dict[
"error_message"
] = "The encoding of your json seems not work out!"
job_response_dict["error_message"] = (
"The encoding of your json seems not work out!"
)
return 406, job_response_dict
try:
storage_provider = get_storage_provider(backend_name)
Expand Down Expand Up @@ -247,9 +247,9 @@ def get_job_status(request, backend_name: str, job_id: str, token: str):
except:
job_response_dict["status"] = "ERROR"
job_response_dict["detail"] = "Error loading json data from input request!"
job_response_dict[
"error_message"
] = "Error loading json data from input request!"
job_response_dict["error_message"] = (
"Error loading json data from input request!"
)
return 406, job_response_dict
try:
# now we download the status json from the backend
Expand All @@ -263,12 +263,12 @@ def get_job_status(request, backend_name: str, job_id: str, token: str):
return 200, job_response_dict
except:
job_response_dict["status"] = "ERROR"
job_response_dict[
"detail"
] = "Error getting status from database. Maybe invalid JOB ID!"
job_response_dict[
"error_message"
] = "Error getting status from database. Maybe invalid JOB ID!"
job_response_dict["detail"] = (
"Error getting status from database. Maybe invalid JOB ID!"
)
job_response_dict["error_message"] = (
"Error getting status from database. Maybe invalid JOB ID!"
)
return 406, job_response_dict


Expand Down Expand Up @@ -319,12 +319,12 @@ def get_job_result(request, backend_name: str, job_id: str, token: str):
if status_msg_draft["status"] != "DONE":
return 200, status_msg_draft
except:
status_msg_draft[
"detail"
] = "Error getting status from database. Maybe invalid JOB ID!"
status_msg_draft[
"error_message"
] = "Error getting status from database. Maybe invalid JOB ID!"
status_msg_draft["detail"] = (
"Error getting status from database. Maybe invalid JOB ID!"
)
status_msg_draft["error_message"] = (
"Error getting status from database. Maybe invalid JOB ID!"
)
return 406, status_msg_draft
# and if the status is switched to done, we can also obtain the result
try:
Expand Down
1 change: 1 addition & 0 deletions src/qlued/apps.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Module that configures the app.
"""

from django.apps import AppConfig


Expand Down
10 changes: 4 additions & 6 deletions src/qlued/storage_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
storage for the jobs.
"""

from sqooler.storage_providers import (
StorageProvider,
MongodbProviderExtended,
DropboxProviderExtended,
LocalProviderExtended,
)
from sqooler.storage_providers.base import StorageProvider
from sqooler.storage_providers.mongodb import MongodbProviderExtended
from sqooler.storage_providers.dropbox import DropboxProviderExtended
from sqooler.storage_providers.local import LocalProviderExtended

from sqooler.schemes import (
MongodbLoginInformation,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_api_v2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The models that define our tests for the api in version 1.
"""

import json
from datetime import datetime
import uuid
Expand All @@ -14,7 +15,7 @@
from django.urls import reverse_lazy
from django.contrib.auth import get_user_model

from sqooler.storage_providers import MongodbProviderExtended as MongodbProvider
from sqooler.storage_providers.mongodb import MongodbProviderExtended as MongodbProvider
from sqooler.schemes import MongodbLoginInformation
from qlued.models import Token, StorageProviderDb
from qlued.storage_providers import get_storage_provider_from_entry
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dropbox_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from django.test import TestCase
from django.contrib.auth import get_user_model

from sqooler.storage_providers import DropboxProviderExtended as DropboxProvider
from sqooler.storage_providers.dropbox import DropboxProviderExtended as DropboxProvider
from sqooler.schemes import DropboxLoginInformation

from qlued.models import StorageProviderDb
Expand Down
3 changes: 2 additions & 1 deletion tests/test_local_provider.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The tests for the local storage provider
"""

import uuid
import shutil

Expand All @@ -10,7 +11,7 @@
from django.contrib.auth import get_user_model
from django.test import TestCase

from sqooler.storage_providers import LocalProviderExtended as LocalProvider
from sqooler.storage_providers.local import LocalProviderExtended as LocalProvider
from sqooler.schemes import LocalLoginInformation, BackendConfigSchemaIn

from qlued.storage_providers import (
Expand Down
1 change: 1 addition & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test the models of this app.
"""

from datetime import datetime
import uuid

Expand Down
3 changes: 2 additions & 1 deletion tests/test_mongodb_provider.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
The tests for the mongodb storage provider
"""

import uuid

from decouple import config
Expand All @@ -9,7 +10,7 @@
from django.contrib.auth import get_user_model
from django.test import TestCase

from sqooler.storage_providers import MongodbProviderExtended as MongodbProvider
from sqooler.storage_providers.mongodb import MongodbProviderExtended as MongodbProvider
from sqooler.schemes import MongodbLoginInformation

from qlued.storage_providers import get_short_backend_name
Expand Down
1 change: 1 addition & 0 deletions tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
to be used only in the test environment. They are not meant to be used in production. We will
always attempt to make them as minimal as possible.
"""

import os
from pathlib import (
Path,
Expand Down

0 comments on commit b02c688

Please sign in to comment.