Skip to content

Commit

Permalink
chore: ran isort
Browse files Browse the repository at this point in the history
  • Loading branch information
abyrne committed Nov 2, 2023
1 parent 4ef7ca5 commit 5923617
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 25 deletions.
4 changes: 1 addition & 3 deletions src/dioptra/restapi/group/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@
from wtforms.validators import Regexp, ValidationError

from dioptra.restapi.app import db
from dioptra.restapi.utils import slugify

from dioptra.restapi.group_membership.model import GroupMembership

from dioptra.restapi.user.model import User
from dioptra.restapi.utils import slugify


class Group(db.Model):
Expand Down
2 changes: 1 addition & 1 deletion src/dioptra/restapi/group/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@

import structlog
from injector import inject
from sqlalchemy.exc import IntegrityError
from structlog.stdlib import BoundLogger
from werkzeug.utils import secure_filename

from dioptra.restapi.app import db

from .model import Group
from sqlalchemy.exc import IntegrityError

LOGGER: BoundLogger = structlog.stdlib.get_logger()

Expand Down
2 changes: 1 addition & 1 deletion src/dioptra/restapi/group_membership/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from flask_wtf.file import FileAllowed, FileField, FileRequired
from typing_extensions import TypedDict
from werkzeug.datastructures import FileStorage
from wtforms.fields import StringField, BooleanField, IntegerField
from wtforms.fields import BooleanField, IntegerField, StringField
from wtforms.validators import UUID, InputRequired
from wtforms.validators import Optional as OptionalField
from wtforms.validators import Regexp, ValidationError
Expand Down
3 changes: 1 addition & 2 deletions src/dioptra/restapi/group_membership/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@

import structlog
from injector import inject
from sqlalchemy.exc import IntegrityError
from structlog.stdlib import BoundLogger
from werkzeug.utils import secure_filename

from dioptra.restapi.app import db

from .model import GroupMembership

from sqlalchemy.exc import IntegrityError

LOGGER: BoundLogger = structlog.stdlib.get_logger()


Expand Down
4 changes: 2 additions & 2 deletions src/dioptra/restapi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
ExperimentRegistrationForm,
ExperimentRegistrationFormData,
)
from .group.model import Group
from .group_membership.model import GroupMembership
from .job.model import Job, JobForm, JobFormData
from .queue.model import (
Queue,
Expand All @@ -35,8 +37,6 @@
TaskPluginUploadFormData,
)
from .user.model import User, UserRegistrationForm, UserRegistrationFormData
from .group.model import Group
from .group_membership.model import GroupMembership

__all__ = [
"Experiment",
Expand Down
3 changes: 1 addition & 2 deletions src/dioptra/restapi/resource copy/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@
from dioptra.restapi.app import db
from dioptra.restapi.utils import slugify

from .interface import JobUpdateInterface

from ..SharedResource import SharedResource
from .interface import JobUpdateInterface

job_statuses = db.Table(
"job_statuses", db.Column("status", db.String(255), primary_key=True)
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/restapi/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
from flask_sqlalchemy import SQLAlchemy
from injector import Binder, Injector
from redis import Redis
from dioptra.restapi.utils import setup_injection

from dioptra.restapi.shared.request_scope import request
from dioptra.restapi.utils import setup_injection


@pytest.fixture(scope="session")
Expand Down
17 changes: 4 additions & 13 deletions tests/unit/restapi/group/test_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,22 @@
"""
from __future__ import annotations

import datetime
from typing import Any

import pytest
from flask.testing import FlaskClient
from flask_sqlalchemy import SQLAlchemy

from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

from werkzeug.test import TestResponse

from dioptra.restapi.queue.routes import BASE_ROUTE as QUEUE_BASE_ROUTE

from dioptra.restapi.group.model import Group
from dioptra.restapi.group.service import GroupService

from dioptra.restapi.group_membership.service import GroupMembershipService

from dioptra.restapi.queue.routes import BASE_ROUTE as QUEUE_BASE_ROUTE
from dioptra.restapi.user.model import User

from dioptra.restapi.group.model import Group


import datetime

import pytest


@pytest.fixture
def group_service() -> GroupService:
Expand Down

0 comments on commit 5923617

Please sign in to comment.