Skip to content

Commit

Permalink
chore: isort force single line
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum committed Apr 8, 2024
1 parent 746c367 commit a0a569d
Show file tree
Hide file tree
Showing 19 changed files with 71 additions and 50 deletions.
3 changes: 2 additions & 1 deletion dsp_permissions_scripts/ap/ap_get.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from typing import Any
from urllib.parse import quote_plus

from dsp_permissions_scripts.ap.ap_model import Ap, ApValue
from dsp_permissions_scripts.ap.ap_model import Ap
from dsp_permissions_scripts.ap.ap_model import ApValue
from dsp_permissions_scripts.models.errors import ApiError
from dsp_permissions_scripts.utils.dsp_client import DspClient
from dsp_permissions_scripts.utils.get_logger import get_logger
Expand Down
3 changes: 2 additions & 1 deletion dsp_permissions_scripts/ap/ap_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from typing import Literal

from dsp_permissions_scripts.ap.ap_model import Ap
from dsp_permissions_scripts.utils.get_logger import get_logger, get_timestamp
from dsp_permissions_scripts.utils.get_logger import get_logger
from dsp_permissions_scripts.utils.get_logger import get_timestamp

logger = get_logger(__name__)

Expand Down
6 changes: 2 additions & 4 deletions dsp_permissions_scripts/ap/ap_set.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from typing import Any
from urllib.parse import quote_plus

from dsp_permissions_scripts.ap.ap_get import (
create_admin_route_object_from_ap,
create_ap_from_admin_route_object,
)
from dsp_permissions_scripts.ap.ap_get import create_admin_route_object_from_ap
from dsp_permissions_scripts.ap.ap_get import create_ap_from_admin_route_object
from dsp_permissions_scripts.ap.ap_model import Ap
from dsp_permissions_scripts.models.errors import ApiError
from dsp_permissions_scripts.utils.dsp_client import DspClient
Expand Down
4 changes: 3 additions & 1 deletion dsp_permissions_scripts/doap/doap_get.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from typing import Any
from urllib.parse import quote_plus

from dsp_permissions_scripts.doap.doap_model import Doap, DoapTarget, DoapTargetType
from dsp_permissions_scripts.doap.doap_model import Doap
from dsp_permissions_scripts.doap.doap_model import DoapTarget
from dsp_permissions_scripts.doap.doap_model import DoapTargetType
from dsp_permissions_scripts.models.errors import ApiError
from dsp_permissions_scripts.utils.dsp_client import DspClient
from dsp_permissions_scripts.utils.get_logger import get_logger
Expand Down
3 changes: 2 additions & 1 deletion dsp_permissions_scripts/doap/doap_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from enum import Enum
from typing import Self

from pydantic import BaseModel, model_validator
from pydantic import BaseModel
from pydantic import model_validator

from dsp_permissions_scripts.models.group import Group
from dsp_permissions_scripts.models.scope import PermissionScope
Expand Down
6 changes: 4 additions & 2 deletions dsp_permissions_scripts/doap/doap_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
from pathlib import Path
from typing import Literal

from dsp_permissions_scripts.doap.doap_model import Doap, DoapTargetType
from dsp_permissions_scripts.utils.get_logger import get_logger, get_timestamp
from dsp_permissions_scripts.doap.doap_model import Doap
from dsp_permissions_scripts.doap.doap_model import DoapTargetType
from dsp_permissions_scripts.utils.get_logger import get_logger
from dsp_permissions_scripts.utils.get_logger import get_timestamp

logger = get_logger(__name__)

Expand Down
4 changes: 3 additions & 1 deletion dsp_permissions_scripts/models/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import re

from pydantic import BaseModel, ConfigDict, model_validator
from pydantic import BaseModel
from pydantic import ConfigDict
from pydantic import model_validator


class Group(BaseModel):
Expand Down
21 changes: 11 additions & 10 deletions dsp_permissions_scripts/models/scope.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
from __future__ import annotations

from typing import Iterable, Literal
from typing import Iterable
from typing import Literal

from pydantic import BaseModel, ConfigDict, model_validator
from pydantic import BaseModel
from pydantic import ConfigDict
from pydantic import model_validator

from dsp_permissions_scripts.models.group import (
CREATOR,
KNOWN_USER,
PROJECT_ADMIN,
PROJECT_MEMBER,
UNKNOWN_USER,
Group,
)
from dsp_permissions_scripts.models.group import CREATOR
from dsp_permissions_scripts.models.group import KNOWN_USER
from dsp_permissions_scripts.models.group import PROJECT_ADMIN
from dsp_permissions_scripts.models.group import PROJECT_MEMBER
from dsp_permissions_scripts.models.group import UNKNOWN_USER
from dsp_permissions_scripts.models.group import Group


class PermissionScope(BaseModel):
Expand Down
5 changes: 3 additions & 2 deletions dsp_permissions_scripts/oap/oap_get.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from typing import Any, Iterable
from typing import Any
from typing import Iterable
from urllib.parse import quote_plus

from dsp_permissions_scripts.models.errors import ApiError
from dsp_permissions_scripts.oap.oap_model import Oap
from dsp_permissions_scripts.utils.dsp_client import DspClient
from dsp_permissions_scripts.utils.get_logger import get_logger
from dsp_permissions_scripts.utils.project import get_all_resource_class_iris_of_project
from dsp_permissions_scripts.utils.project import (
get_all_resource_class_iris_of_project,
get_project_iri_and_onto_iris_by_shortcode,
)
from dsp_permissions_scripts.utils.scope_serialization import create_scope_from_string
Expand Down
6 changes: 4 additions & 2 deletions dsp_permissions_scripts/oap/oap_set.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# pylint: disable=too-many-arguments

from concurrent.futures import ThreadPoolExecutor, as_completed
from concurrent.futures import ThreadPoolExecutor
from concurrent.futures import as_completed
from datetime import datetime
from typing import Any

from dsp_permissions_scripts.models.errors import ApiError, PermissionsAlreadyUpToDate
from dsp_permissions_scripts.models.errors import ApiError
from dsp_permissions_scripts.models.errors import PermissionsAlreadyUpToDate
from dsp_permissions_scripts.models.scope import PermissionScope
from dsp_permissions_scripts.models.value import ValueUpdate
from dsp_permissions_scripts.oap.oap_get import get_resource
Expand Down
3 changes: 2 additions & 1 deletion dsp_permissions_scripts/template.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from dsp_permissions_scripts.ap.ap_delete import delete_ap_of_group_on_server
from dsp_permissions_scripts.ap.ap_get import get_aps_of_project
from dsp_permissions_scripts.ap.ap_model import Ap, ApValue
from dsp_permissions_scripts.ap.ap_model import Ap
from dsp_permissions_scripts.ap.ap_model import ApValue
from dsp_permissions_scripts.ap.ap_serialize import serialize_aps_of_project
from dsp_permissions_scripts.ap.ap_set import apply_updated_aps_on_server
from dsp_permissions_scripts.doap.doap_get import get_doaps_of_project
Expand Down
20 changes: 14 additions & 6 deletions dsp_permissions_scripts/utils/dsp_client.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import json
import re
import time
from dataclasses import dataclass, field
from dataclasses import dataclass
from dataclasses import field
from functools import partial
from importlib.metadata import version
from typing import Any, Literal, Optional, cast

from requests import ReadTimeout, RequestException, Response, Session

from dsp_permissions_scripts.models.errors import ApiError, PermissionsAlreadyUpToDate
from typing import Any
from typing import Literal
from typing import Optional
from typing import cast

from requests import ReadTimeout
from requests import RequestException
from requests import Response
from requests import Session

from dsp_permissions_scripts.models.errors import ApiError
from dsp_permissions_scripts.models.errors import PermissionsAlreadyUpToDate
from dsp_permissions_scripts.utils.get_logger import get_logger

logger = get_logger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion dsp_permissions_scripts/utils/try_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from typing import Callable

import requests
from requests import ReadTimeout, RequestException
from requests import ReadTimeout
from requests import RequestException
from urllib3.exceptions import ReadTimeoutError

from dsp_permissions_scripts.utils.get_logger import get_logger
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ line-length = 120

[tool.isort]
profile = "black"
force_single_line = true

[tool.mypy]
ignore_missing_imports = false
Expand Down
3 changes: 2 additions & 1 deletion tests/test_ap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import unittest

from dsp_permissions_scripts.ap.ap_model import Ap, ApValue
from dsp_permissions_scripts.ap.ap_model import Ap
from dsp_permissions_scripts.ap.ap_model import ApValue
from dsp_permissions_scripts.models import group


Expand Down
9 changes: 4 additions & 5 deletions tests/test_ap_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
import unittest
from pathlib import Path

from dsp_permissions_scripts.ap.ap_model import Ap, ApValue
from dsp_permissions_scripts.ap.ap_serialize import (
deserialize_aps_of_project,
serialize_aps_of_project,
)
from dsp_permissions_scripts.ap.ap_model import Ap
from dsp_permissions_scripts.ap.ap_model import ApValue
from dsp_permissions_scripts.ap.ap_serialize import deserialize_aps_of_project
from dsp_permissions_scripts.ap.ap_serialize import serialize_aps_of_project
from dsp_permissions_scripts.models import group
from dsp_permissions_scripts.models.host import Hosts

Expand Down
9 changes: 4 additions & 5 deletions tests/test_doap_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
import unittest
from pathlib import Path

from dsp_permissions_scripts.doap.doap_model import Doap, DoapTarget
from dsp_permissions_scripts.doap.doap_serialize import (
deserialize_doaps_of_project,
serialize_doaps_of_project,
)
from dsp_permissions_scripts.doap.doap_model import Doap
from dsp_permissions_scripts.doap.doap_model import DoapTarget
from dsp_permissions_scripts.doap.doap_serialize import deserialize_doaps_of_project
from dsp_permissions_scripts.doap.doap_serialize import serialize_doaps_of_project
from dsp_permissions_scripts.models import group
from dsp_permissions_scripts.models.host import Hosts
from dsp_permissions_scripts.models.scope import PermissionScope
Expand Down
6 changes: 2 additions & 4 deletions tests/test_oap_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
from dsp_permissions_scripts.models import group
from dsp_permissions_scripts.models.scope import PermissionScope
from dsp_permissions_scripts.oap.oap_model import Oap
from dsp_permissions_scripts.oap.oap_serialize import (
deserialize_resource_oaps,
serialize_resource_oaps,
)
from dsp_permissions_scripts.oap.oap_serialize import deserialize_resource_oaps
from dsp_permissions_scripts.oap.oap_serialize import serialize_resource_oaps
from tests.test_scope_serialization import compare_scopes


Expand Down
6 changes: 4 additions & 2 deletions tests/test_scope_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
from dsp_permissions_scripts.models.scope import PermissionScope
from dsp_permissions_scripts.utils.scope_serialization import (
create_admin_route_object_from_scope,
)
from dsp_permissions_scripts.utils.scope_serialization import (
create_scope_from_admin_route_object,
create_scope_from_string,
create_string_from_scope,
)
from dsp_permissions_scripts.utils.scope_serialization import create_scope_from_string
from dsp_permissions_scripts.utils.scope_serialization import create_string_from_scope


def compare_scopes(
Expand Down

0 comments on commit a0a569d

Please sign in to comment.