diff --git a/pyproject.toml b/pyproject.toml index f5d2a10be..01578de43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -211,4 +211,5 @@ convention = "google" [tool.ruff.lint.isort] +force-single-line = true known-first-party = ["dsp_tools"] diff --git a/src/dsp_tools/cli/call_action.py b/src/dsp_tools/cli/call_action.py index 6b5dd6e6d..b5b7d18b0 100644 --- a/src/dsp_tools/cli/call_action.py +++ b/src/dsp_tools/cli/call_action.py @@ -1,7 +1,8 @@ import argparse from pathlib import Path -from dsp_tools.commands.excel2json.lists import excel2lists, validate_lists_section_with_schema +from dsp_tools.commands.excel2json.lists import excel2lists +from dsp_tools.commands.excel2json.lists import validate_lists_section_with_schema from dsp_tools.commands.excel2json.project import excel2json from dsp_tools.commands.excel2json.properties import excel2properties from dsp_tools.commands.excel2json.resources import excel2resources @@ -13,9 +14,11 @@ from dsp_tools.commands.project.create.project_validate import validate_project from dsp_tools.commands.project.get import get_project from dsp_tools.commands.rosetta import upload_rosetta -from dsp_tools.commands.start_stack import StackConfiguration, StackHandler +from dsp_tools.commands.start_stack import StackConfiguration +from dsp_tools.commands.start_stack import StackHandler from dsp_tools.commands.template import generate_template_repo -from dsp_tools.commands.xmlupload.upload_config import DiagnosticsConfig, UploadConfig +from dsp_tools.commands.xmlupload.upload_config import DiagnosticsConfig +from dsp_tools.commands.xmlupload.upload_config import UploadConfig from dsp_tools.commands.xmlupload.xmlupload import xmlupload from dsp_tools.utils.create_logger import get_logger from dsp_tools.utils.xml_validation import validate_xml diff --git a/src/dsp_tools/cli/create_parsers.py b/src/dsp_tools/cli/create_parsers.py index 6c23fcfc0..7635849c7 100644 --- a/src/dsp_tools/cli/create_parsers.py +++ b/src/dsp_tools/cli/create_parsers.py @@ -1,7 +1,8 @@ from __future__ import annotations import datetime -from argparse import ArgumentParser, _SubParsersAction +from argparse import ArgumentParser +from argparse import _SubParsersAction from importlib.metadata import version # help texts diff --git a/src/dsp_tools/cli/entry_point.py b/src/dsp_tools/cli/entry_point.py index 5abcbf5b6..bb194af2d 100644 --- a/src/dsp_tools/cli/entry_point.py +++ b/src/dsp_tools/cli/entry_point.py @@ -13,7 +13,9 @@ from dsp_tools.cli.call_action import call_requested_action from dsp_tools.cli.create_parsers import make_parser -from dsp_tools.models.exceptions import BaseError, InternalError, UserError +from dsp_tools.models.exceptions import BaseError +from dsp_tools.models.exceptions import InternalError +from dsp_tools.models.exceptions import UserError from dsp_tools.utils.create_logger import get_logger logger = get_logger(__name__) diff --git a/src/dsp_tools/commands/excel2json/lists.py b/src/dsp_tools/commands/excel2json/lists.py index 933d0d82d..ff0627032 100644 --- a/src/dsp_tools/commands/excel2json/lists.py +++ b/src/dsp_tools/commands/excel2json/lists.py @@ -3,7 +3,9 @@ import json from copy import deepcopy from pathlib import Path -from typing import Any, Optional, Union +from typing import Any +from typing import Optional +from typing import Union import jsonschema import regex @@ -13,7 +15,9 @@ from dsp_tools.commands.excel2json.models.input_error import MoreThanOneSheetProblem from dsp_tools.commands.excel2json.models.list_node_name import ListNodeNames -from dsp_tools.models.exceptions import BaseError, InputError, UserError +from dsp_tools.models.exceptions import BaseError +from dsp_tools.models.exceptions import InputError +from dsp_tools.models.exceptions import UserError from dsp_tools.utils.shared import simplify_name diff --git a/src/dsp_tools/commands/excel2json/models/input_error.py b/src/dsp_tools/commands/excel2json/models/input_error.py index f29a5258f..d1fc6e5d3 100644 --- a/src/dsp_tools/commands/excel2json/models/input_error.py +++ b/src/dsp_tools/commands/excel2json/models/input_error.py @@ -1,5 +1,6 @@ from dataclasses import dataclass -from typing import Any, Protocol +from typing import Any +from typing import Protocol separator = "\n " list_separator = "\n - " diff --git a/src/dsp_tools/commands/excel2json/models/list_node_name.py b/src/dsp_tools/commands/excel2json/models/list_node_name.py index 4d11799bc..a9f3f69ed 100644 --- a/src/dsp_tools/commands/excel2json/models/list_node_name.py +++ b/src/dsp_tools/commands/excel2json/models/list_node_name.py @@ -1,4 +1,5 @@ -from dataclasses import dataclass, field +from dataclasses import dataclass +from dataclasses import field @dataclass diff --git a/src/dsp_tools/commands/excel2json/properties.py b/src/dsp_tools/commands/excel2json/properties.py index 7c4e98d05..f506e60c7 100644 --- a/src/dsp_tools/commands/excel2json/properties.py +++ b/src/dsp_tools/commands/excel2json/properties.py @@ -3,7 +3,8 @@ import importlib.resources import json import warnings -from typing import Any, Optional +from typing import Any +from typing import Optional import jsonpath_ng.ext import jsonschema @@ -11,25 +12,21 @@ import pandas as pd import regex -from dsp_tools.commands.excel2json.models.input_error import ( - InvalidExcelContentProblem, - JsonValidationPropertyProblem, - MissingValuesInRowProblem, - MoreThanOneSheetProblem, - PositionInExcel, - Problem, -) -from dsp_tools.commands.excel2json.utils import ( - check_column_for_duplicate, - check_contains_required_columns, - check_required_values, - col_must_or_not_empty_based_on_other_col, - find_one_full_cell_in_cols, - get_comments, - get_labels, - get_wrong_row_numbers, - read_and_clean_all_sheets, -) +from dsp_tools.commands.excel2json.models.input_error import InvalidExcelContentProblem +from dsp_tools.commands.excel2json.models.input_error import JsonValidationPropertyProblem +from dsp_tools.commands.excel2json.models.input_error import MissingValuesInRowProblem +from dsp_tools.commands.excel2json.models.input_error import MoreThanOneSheetProblem +from dsp_tools.commands.excel2json.models.input_error import PositionInExcel +from dsp_tools.commands.excel2json.models.input_error import Problem +from dsp_tools.commands.excel2json.utils import check_column_for_duplicate +from dsp_tools.commands.excel2json.utils import check_contains_required_columns +from dsp_tools.commands.excel2json.utils import check_required_values +from dsp_tools.commands.excel2json.utils import col_must_or_not_empty_based_on_other_col +from dsp_tools.commands.excel2json.utils import find_one_full_cell_in_cols +from dsp_tools.commands.excel2json.utils import get_comments +from dsp_tools.commands.excel2json.utils import get_labels +from dsp_tools.commands.excel2json.utils import get_wrong_row_numbers +from dsp_tools.commands.excel2json.utils import read_and_clean_all_sheets from dsp_tools.models.exceptions import InputError languages = ["en", "de", "fr", "it", "rm"] diff --git a/src/dsp_tools/commands/excel2json/resources.py b/src/dsp_tools/commands/excel2json/resources.py index 3e0d93bde..71c45c79d 100644 --- a/src/dsp_tools/commands/excel2json/resources.py +++ b/src/dsp_tools/commands/excel2json/resources.py @@ -1,23 +1,24 @@ import importlib.resources import json import warnings -from typing import Any, Optional +from typing import Any +from typing import Optional import jsonpath_ng.ext import jsonschema import pandas as pd import regex -from dsp_tools.commands.excel2json.models.input_error import ( - JsonValidationResourceProblem, - MissingValuesInRowProblem, - PositionInExcel, - Problem, - ResourcesSheetsNotAsExpected, -) -from dsp_tools.commands.excel2json.utils import check_column_for_duplicate, read_and_clean_all_sheets +from dsp_tools.commands.excel2json.models.input_error import JsonValidationResourceProblem +from dsp_tools.commands.excel2json.models.input_error import MissingValuesInRowProblem +from dsp_tools.commands.excel2json.models.input_error import PositionInExcel +from dsp_tools.commands.excel2json.models.input_error import Problem +from dsp_tools.commands.excel2json.models.input_error import ResourcesSheetsNotAsExpected +from dsp_tools.commands.excel2json.utils import check_column_for_duplicate +from dsp_tools.commands.excel2json.utils import read_and_clean_all_sheets from dsp_tools.models.exceptions import InputError -from dsp_tools.utils.shared import check_notna, prepare_dataframe +from dsp_tools.utils.shared import check_notna +from dsp_tools.utils.shared import prepare_dataframe languages = ["en", "de", "fr", "it", "rm"] diff --git a/src/dsp_tools/commands/excel2json/utils.py b/src/dsp_tools/commands/excel2json/utils.py index 7e27441d7..e06e2958d 100644 --- a/src/dsp_tools/commands/excel2json/utils.py +++ b/src/dsp_tools/commands/excel2json/utils.py @@ -7,11 +7,9 @@ import pandas as pd import regex -from dsp_tools.commands.excel2json.models.input_error import ( - DuplicatesInColumnProblem, - InvalidSheetNameProblem, - RequiredColumnMissingProblem, -) +from dsp_tools.commands.excel2json.models.input_error import DuplicatesInColumnProblem +from dsp_tools.commands.excel2json.models.input_error import InvalidSheetNameProblem +from dsp_tools.commands.excel2json.models.input_error import RequiredColumnMissingProblem from dsp_tools.models.exceptions import InputError languages = ["en", "de", "fr", "it", "rm"] diff --git a/src/dsp_tools/commands/excel2xml/excel2xml_cli.py b/src/dsp_tools/commands/excel2xml/excel2xml_cli.py index 5cdd503ac..408e2db5a 100644 --- a/src/dsp_tools/commands/excel2xml/excel2xml_cli.py +++ b/src/dsp_tools/commands/excel2xml/excel2xml_cli.py @@ -2,34 +2,34 @@ import warnings from pathlib import Path -from typing import Callable, Optional, Union +from typing import Callable +from typing import Optional +from typing import Union import pandas as pd import regex from lxml import etree -from dsp_tools.commands.excel2xml.excel2xml_lib import ( - append_permissions, - make_annotation, - make_bitstream_prop, - make_boolean_prop, - make_color_prop, - make_date_prop, - make_decimal_prop, - make_geometry_prop, - make_geoname_prop, - make_integer_prop, - make_interval_prop, - make_link, - make_list_prop, - make_region, - make_resource, - make_resptr_prop, - make_root, - make_text_prop, - make_uri_prop, - write_xml, -) +from dsp_tools.commands.excel2xml.excel2xml_lib import append_permissions +from dsp_tools.commands.excel2xml.excel2xml_lib import make_annotation +from dsp_tools.commands.excel2xml.excel2xml_lib import make_bitstream_prop +from dsp_tools.commands.excel2xml.excel2xml_lib import make_boolean_prop +from dsp_tools.commands.excel2xml.excel2xml_lib import make_color_prop +from dsp_tools.commands.excel2xml.excel2xml_lib import make_date_prop +from dsp_tools.commands.excel2xml.excel2xml_lib import make_decimal_prop +from dsp_tools.commands.excel2xml.excel2xml_lib import make_geometry_prop +from dsp_tools.commands.excel2xml.excel2xml_lib import make_geoname_prop +from dsp_tools.commands.excel2xml.excel2xml_lib import make_integer_prop +from dsp_tools.commands.excel2xml.excel2xml_lib import make_interval_prop +from dsp_tools.commands.excel2xml.excel2xml_lib import make_link +from dsp_tools.commands.excel2xml.excel2xml_lib import make_list_prop +from dsp_tools.commands.excel2xml.excel2xml_lib import make_region +from dsp_tools.commands.excel2xml.excel2xml_lib import make_resource +from dsp_tools.commands.excel2xml.excel2xml_lib import make_resptr_prop +from dsp_tools.commands.excel2xml.excel2xml_lib import make_root +from dsp_tools.commands.excel2xml.excel2xml_lib import make_text_prop +from dsp_tools.commands.excel2xml.excel2xml_lib import make_uri_prop +from dsp_tools.commands.excel2xml.excel2xml_lib import write_xml from dsp_tools.commands.excel2xml.propertyelement import PropertyElement from dsp_tools.models.exceptions import BaseError from dsp_tools.utils.shared import check_notna diff --git a/src/dsp_tools/commands/excel2xml/excel2xml_lib.py b/src/dsp_tools/commands/excel2xml/excel2xml_lib.py index f266ab331..4bf62be7e 100644 --- a/src/dsp_tools/commands/excel2xml/excel2xml_lib.py +++ b/src/dsp_tools/commands/excel2xml/excel2xml_lib.py @@ -6,7 +6,10 @@ import uuid import warnings from pathlib import Path -from typing import Any, Iterable, Optional, Union +from typing import Any +from typing import Iterable +from typing import Optional +from typing import Union import regex from lxml import etree @@ -17,7 +20,8 @@ from dsp_tools.models.datetimestamp import DateTimeStamp from dsp_tools.models.exceptions import BaseError from dsp_tools.utils.date_util import is_full_date -from dsp_tools.utils.shared import check_notna, simplify_name +from dsp_tools.utils.shared import check_notna +from dsp_tools.utils.shared import simplify_name from dsp_tools.utils.uri_util import is_uri from dsp_tools.utils.xml_validation import validate_xml diff --git a/src/dsp_tools/commands/excel2xml/propertyelement.py b/src/dsp_tools/commands/excel2xml/propertyelement.py index 6cd3c111a..5aeacfd96 100644 --- a/src/dsp_tools/commands/excel2xml/propertyelement.py +++ b/src/dsp_tools/commands/excel2xml/propertyelement.py @@ -1,5 +1,6 @@ from dataclasses import dataclass -from typing import Optional, Union +from typing import Optional +from typing import Union from dsp_tools.models.exceptions import BaseError diff --git a/src/dsp_tools/commands/ingest_xmlupload/upload_xml.py b/src/dsp_tools/commands/ingest_xmlupload/upload_xml.py index b822dbe57..c7e435210 100644 --- a/src/dsp_tools/commands/ingest_xmlupload/upload_xml.py +++ b/src/dsp_tools/commands/ingest_xmlupload/upload_xml.py @@ -4,10 +4,8 @@ from lxml import etree -from dsp_tools.commands.ingest_xmlupload.apply_ingest_id import ( - get_mapping_dict_from_file, - replace_filepath_with_sipi_id, -) +from dsp_tools.commands.ingest_xmlupload.apply_ingest_id import get_mapping_dict_from_file +from dsp_tools.commands.ingest_xmlupload.apply_ingest_id import replace_filepath_with_sipi_id from dsp_tools.commands.xmlupload.upload_config import UploadConfig from dsp_tools.commands.xmlupload.xmlupload import xmlupload from dsp_tools.models.exceptions import InputError diff --git a/src/dsp_tools/commands/ingest_xmlupload/user_information.py b/src/dsp_tools/commands/ingest_xmlupload/user_information.py index 1860d65d9..df1a84bef 100644 --- a/src/dsp_tools/commands/ingest_xmlupload/user_information.py +++ b/src/dsp_tools/commands/ingest_xmlupload/user_information.py @@ -1,4 +1,5 @@ -from dataclasses import dataclass, field +from dataclasses import dataclass +from dataclasses import field from pathlib import Path import pandas as pd diff --git a/src/dsp_tools/commands/project/create/project_create.py b/src/dsp_tools/commands/project/create/project_create.py index b6ef55061..a6ebc050f 100644 --- a/src/dsp_tools/commands/project/create/project_create.py +++ b/src/dsp_tools/commands/project/create/project_create.py @@ -2,7 +2,10 @@ of the project, the creation of groups, users, lists, resource classes, properties and cardinalities.""" from pathlib import Path -from typing import Any, Optional, Union, cast +from typing import Any +from typing import Optional +from typing import Union +from typing import cast import regex @@ -19,7 +22,8 @@ from dsp_tools.commands.project.models.resourceclass import ResourceClass from dsp_tools.commands.project.models.user import User from dsp_tools.models.datetimestamp import DateTimeStamp -from dsp_tools.models.exceptions import BaseError, UserError +from dsp_tools.models.exceptions import BaseError +from dsp_tools.models.exceptions import UserError from dsp_tools.models.langstring import LangString from dsp_tools.utils.connection import Connection from dsp_tools.utils.connection_live import ConnectionLive diff --git a/src/dsp_tools/commands/project/create/project_create_lists.py b/src/dsp_tools/commands/project/create/project_create_lists.py index 2e2263224..af89f9937 100644 --- a/src/dsp_tools/commands/project/create/project_create_lists.py +++ b/src/dsp_tools/commands/project/create/project_create_lists.py @@ -1,10 +1,13 @@ -from typing import Any, Optional, Union +from typing import Any +from typing import Optional +from typing import Union from dsp_tools.commands.excel2json.lists import expand_lists_from_excel from dsp_tools.commands.project.create.project_validate import validate_project from dsp_tools.commands.project.models.listnode import ListNode from dsp_tools.commands.project.models.project import Project -from dsp_tools.models.exceptions import BaseError, UserError +from dsp_tools.models.exceptions import BaseError +from dsp_tools.models.exceptions import UserError from dsp_tools.utils.connection import Connection from dsp_tools.utils.connection_live import ConnectionLive from dsp_tools.utils.create_logger import get_logger diff --git a/src/dsp_tools/commands/project/create/project_validate.py b/src/dsp_tools/commands/project/create/project_validate.py index f73df2184..c0c683e57 100644 --- a/src/dsp_tools/commands/project/create/project_validate.py +++ b/src/dsp_tools/commands/project/create/project_validate.py @@ -1,7 +1,8 @@ import importlib.resources import json from pathlib import Path -from typing import Any, Union +from typing import Any +from typing import Union import jsonpath_ng import jsonpath_ng.ext diff --git a/src/dsp_tools/commands/project/models/context.py b/src/dsp_tools/commands/project/models/context.py index 6908b56b4..a9d2b50ed 100644 --- a/src/dsp_tools/commands/project/models/context.py +++ b/src/dsp_tools/commands/project/models/context.py @@ -4,7 +4,8 @@ import regex -from dsp_tools.commands.project.models.helpers import ContextType, OntoIri +from dsp_tools.commands.project.models.helpers import ContextType +from dsp_tools.commands.project.models.helpers import OntoIri from dsp_tools.models.exceptions import BaseError from dsp_tools.utils.iri_util import is_iri diff --git a/src/dsp_tools/commands/project/models/group.py b/src/dsp_tools/commands/project/models/group.py index e3cfa5f93..434bcfd27 100644 --- a/src/dsp_tools/commands/project/models/group.py +++ b/src/dsp_tools/commands/project/models/group.py @@ -23,7 +23,9 @@ from __future__ import annotations -from typing import Any, Optional, Union +from typing import Any +from typing import Optional +from typing import Union from urllib.parse import quote_plus from dsp_tools.commands.project.models.model import Model diff --git a/src/dsp_tools/commands/project/models/helpers.py b/src/dsp_tools/commands/project/models/helpers.py index 7ead1028f..937d6ceeb 100644 --- a/src/dsp_tools/commands/project/models/helpers.py +++ b/src/dsp_tools/commands/project/models/helpers.py @@ -1,7 +1,8 @@ from __future__ import annotations from dataclasses import dataclass -from enum import Enum, unique +from enum import Enum +from enum import unique from typing import Optional diff --git a/src/dsp_tools/commands/project/models/listnode.py b/src/dsp_tools/commands/project/models/listnode.py index bba2ec2fb..a61819d75 100644 --- a/src/dsp_tools/commands/project/models/listnode.py +++ b/src/dsp_tools/commands/project/models/listnode.py @@ -12,7 +12,9 @@ """ from __future__ import annotations -from typing import Any, Optional, Union +from typing import Any +from typing import Optional +from typing import Union from urllib.parse import quote_plus from dsp_tools.commands.project.models.model import Model diff --git a/src/dsp_tools/commands/project/models/ontology.py b/src/dsp_tools/commands/project/models/ontology.py index d9ff26de1..ab82021c1 100644 --- a/src/dsp_tools/commands/project/models/ontology.py +++ b/src/dsp_tools/commands/project/models/ontology.py @@ -18,7 +18,9 @@ from __future__ import annotations import copy -from typing import Any, Optional, Union +from typing import Any +from typing import Optional +from typing import Union from urllib.parse import quote_plus import regex diff --git a/src/dsp_tools/commands/project/models/project.py b/src/dsp_tools/commands/project/models/project.py index a7934cf80..dfdaa0d1b 100644 --- a/src/dsp_tools/commands/project/models/project.py +++ b/src/dsp_tools/commands/project/models/project.py @@ -14,7 +14,9 @@ from __future__ import annotations -from typing import Any, Optional, Union +from typing import Any +from typing import Optional +from typing import Union from urllib.parse import quote_plus from dsp_tools.commands.project.models.model import Model diff --git a/src/dsp_tools/commands/project/models/propertyclass.py b/src/dsp_tools/commands/project/models/propertyclass.py index 18a2d2e6c..341550676 100644 --- a/src/dsp_tools/commands/project/models/propertyclass.py +++ b/src/dsp_tools/commands/project/models/propertyclass.py @@ -1,6 +1,9 @@ from __future__ import annotations -from typing import Any, Optional, Sequence, Union +from typing import Any +from typing import Optional +from typing import Sequence +from typing import Union from urllib.parse import quote_plus import regex diff --git a/src/dsp_tools/commands/project/models/resourceclass.py b/src/dsp_tools/commands/project/models/resourceclass.py index 72e6b7273..6c11d3f1c 100644 --- a/src/dsp_tools/commands/project/models/resourceclass.py +++ b/src/dsp_tools/commands/project/models/resourceclass.py @@ -8,7 +8,10 @@ from __future__ import annotations from enum import Enum -from typing import Any, Optional, Sequence, Union +from typing import Any +from typing import Optional +from typing import Sequence +from typing import Union from urllib.parse import quote_plus import regex diff --git a/src/dsp_tools/commands/project/models/user.py b/src/dsp_tools/commands/project/models/user.py index e3cdaf8d0..ba3ca41b6 100644 --- a/src/dsp_tools/commands/project/models/user.py +++ b/src/dsp_tools/commands/project/models/user.py @@ -16,7 +16,9 @@ from __future__ import annotations import urllib.parse -from typing import Any, Optional, Union +from typing import Any +from typing import Optional +from typing import Union from urllib.parse import quote_plus from dsp_tools.commands.project.models.group import Group diff --git a/src/dsp_tools/commands/xmlupload/check_consistency_with_ontology.py b/src/dsp_tools/commands/xmlupload/check_consistency_with_ontology.py index 9ce8a1f31..ee690e1a6 100644 --- a/src/dsp_tools/commands/xmlupload/check_consistency_with_ontology.py +++ b/src/dsp_tools/commands/xmlupload/check_consistency_with_ontology.py @@ -6,18 +6,14 @@ from lxml import etree from regex import Pattern -from dsp_tools.commands.xmlupload.models.ontology_lookup_models import ( - AllowedEncodings, - ProjectOntosInformation, - PropertyTextValueTypes, - TextValueData, - get_text_value_types_of_properties_from_onto, - make_project_onto_information, -) -from dsp_tools.commands.xmlupload.models.ontology_problem_models import ( - InvalidOntologyElementsInData, - InvalidTextValueEncodings, -) +from dsp_tools.commands.xmlupload.models.ontology_lookup_models import AllowedEncodings +from dsp_tools.commands.xmlupload.models.ontology_lookup_models import ProjectOntosInformation +from dsp_tools.commands.xmlupload.models.ontology_lookup_models import PropertyTextValueTypes +from dsp_tools.commands.xmlupload.models.ontology_lookup_models import TextValueData +from dsp_tools.commands.xmlupload.models.ontology_lookup_models import get_text_value_types_of_properties_from_onto +from dsp_tools.commands.xmlupload.models.ontology_lookup_models import make_project_onto_information +from dsp_tools.commands.xmlupload.models.ontology_problem_models import InvalidOntologyElementsInData +from dsp_tools.commands.xmlupload.models.ontology_problem_models import InvalidTextValueEncodings from dsp_tools.commands.xmlupload.ontology_client import OntologyClient from dsp_tools.models.exceptions import InputError diff --git a/src/dsp_tools/commands/xmlupload/iri_resolver.py b/src/dsp_tools/commands/xmlupload/iri_resolver.py index 78273c1c1..8c5b0d7e9 100644 --- a/src/dsp_tools/commands/xmlupload/iri_resolver.py +++ b/src/dsp_tools/commands/xmlupload/iri_resolver.py @@ -1,4 +1,5 @@ -from dataclasses import dataclass, field +from dataclasses import dataclass +from dataclasses import field @dataclass diff --git a/src/dsp_tools/commands/xmlupload/list_client.py b/src/dsp_tools/commands/xmlupload/list_client.py index 49f3f93e7..82b644715 100644 --- a/src/dsp_tools/commands/xmlupload/list_client.py +++ b/src/dsp_tools/commands/xmlupload/list_client.py @@ -1,7 +1,10 @@ from __future__ import annotations -from dataclasses import dataclass, field -from typing import Any, Iterable, Protocol +from dataclasses import dataclass +from dataclasses import field +from typing import Any +from typing import Iterable +from typing import Protocol from urllib.parse import quote_plus from dsp_tools.utils.connection import Connection diff --git a/src/dsp_tools/commands/xmlupload/models/ontology_lookup_models.py b/src/dsp_tools/commands/xmlupload/models/ontology_lookup_models.py index 92f907b51..942ada2b3 100644 --- a/src/dsp_tools/commands/xmlupload/models/ontology_lookup_models.py +++ b/src/dsp_tools/commands/xmlupload/models/ontology_lookup_models.py @@ -1,5 +1,7 @@ -from dataclasses import dataclass, field -from typing import Any, Literal +from dataclasses import dataclass +from dataclasses import field +from typing import Any +from typing import Literal import regex diff --git a/src/dsp_tools/commands/xmlupload/models/permission.py b/src/dsp_tools/commands/xmlupload/models/permission.py index 22e1c2854..734a96f33 100644 --- a/src/dsp_tools/commands/xmlupload/models/permission.py +++ b/src/dsp_tools/commands/xmlupload/models/permission.py @@ -1,7 +1,9 @@ from __future__ import annotations -from enum import Enum, unique -from typing import Optional, Union +from enum import Enum +from enum import unique +from typing import Optional +from typing import Union import regex diff --git a/src/dsp_tools/commands/xmlupload/models/xmlbitstream.py b/src/dsp_tools/commands/xmlupload/models/xmlbitstream.py index 7fbbaade6..ae19c32ce 100644 --- a/src/dsp_tools/commands/xmlupload/models/xmlbitstream.py +++ b/src/dsp_tools/commands/xmlupload/models/xmlbitstream.py @@ -1,4 +1,5 @@ -from typing import Optional, cast +from typing import Optional +from typing import cast from lxml import etree diff --git a/src/dsp_tools/commands/xmlupload/models/xmlvalue.py b/src/dsp_tools/commands/xmlupload/models/xmlvalue.py index e6bbfa9e6..c007c9db3 100644 --- a/src/dsp_tools/commands/xmlupload/models/xmlvalue.py +++ b/src/dsp_tools/commands/xmlupload/models/xmlvalue.py @@ -1,4 +1,6 @@ -from typing import Optional, Union, cast +from typing import Optional +from typing import Union +from typing import cast import regex from lxml import etree diff --git a/src/dsp_tools/commands/xmlupload/ontology_client.py b/src/dsp_tools/commands/xmlupload/ontology_client.py index 9ea9ec338..5a9465e97 100644 --- a/src/dsp_tools/commands/xmlupload/ontology_client.py +++ b/src/dsp_tools/commands/xmlupload/ontology_client.py @@ -1,7 +1,10 @@ -from dataclasses import dataclass, field -from typing import Any, Protocol +from dataclasses import dataclass +from dataclasses import field +from typing import Any +from typing import Protocol -from dsp_tools.models.exceptions import BaseError, UserError +from dsp_tools.models.exceptions import BaseError +from dsp_tools.models.exceptions import UserError from dsp_tools.utils.connection import Connection from dsp_tools.utils.create_logger import get_logger diff --git a/src/dsp_tools/commands/xmlupload/project_client.py b/src/dsp_tools/commands/xmlupload/project_client.py index e5e9d0489..e1a41da71 100644 --- a/src/dsp_tools/commands/xmlupload/project_client.py +++ b/src/dsp_tools/commands/xmlupload/project_client.py @@ -1,8 +1,10 @@ -from dataclasses import dataclass, field +from dataclasses import dataclass +from dataclasses import field from typing import Protocol from urllib.parse import quote_plus -from dsp_tools.models.exceptions import BaseError, UserError +from dsp_tools.models.exceptions import BaseError +from dsp_tools.models.exceptions import UserError from dsp_tools.utils.connection import Connection from dsp_tools.utils.create_logger import get_logger diff --git a/src/dsp_tools/commands/xmlupload/read_validate_xml_file.py b/src/dsp_tools/commands/xmlupload/read_validate_xml_file.py index acb7f431d..feaa37ba5 100644 --- a/src/dsp_tools/commands/xmlupload/read_validate_xml_file.py +++ b/src/dsp_tools/commands/xmlupload/read_validate_xml_file.py @@ -1,7 +1,8 @@ from __future__ import annotations from pathlib import Path -from typing import Any, Union +from typing import Any +from typing import Union import regex from lxml import etree diff --git a/src/dsp_tools/commands/xmlupload/resource_create_client.py b/src/dsp_tools/commands/xmlupload/resource_create_client.py index a2bf815b7..bca79d1cf 100644 --- a/src/dsp_tools/commands/xmlupload/resource_create_client.py +++ b/src/dsp_tools/commands/xmlupload/resource_create_client.py @@ -1,16 +1,19 @@ import json from dataclasses import dataclass from pathlib import Path -from typing import Any, assert_never +from typing import Any +from typing import assert_never from dsp_tools.commands.xmlupload.ark2iri import convert_ark_v0_to_resource_iri from dsp_tools.commands.xmlupload.iri_resolver import IriResolver from dsp_tools.commands.xmlupload.models.formatted_text_value import FormattedTextValue from dsp_tools.commands.xmlupload.models.permission import Permissions from dsp_tools.commands.xmlupload.models.xmlproperty import XMLProperty -from dsp_tools.commands.xmlupload.models.xmlresource import BitstreamInfo, XMLResource +from dsp_tools.commands.xmlupload.models.xmlresource import BitstreamInfo +from dsp_tools.commands.xmlupload.models.xmlresource import XMLResource from dsp_tools.commands.xmlupload.models.xmlvalue import XMLValue -from dsp_tools.models.exceptions import BaseError, UserError +from dsp_tools.models.exceptions import BaseError +from dsp_tools.models.exceptions import UserError from dsp_tools.utils.connection import Connection from dsp_tools.utils.create_logger import get_logger from dsp_tools.utils.date_util import parse_date_string diff --git a/src/dsp_tools/commands/xmlupload/resource_multimedia.py b/src/dsp_tools/commands/xmlupload/resource_multimedia.py index b7eef6472..832f256b7 100644 --- a/src/dsp_tools/commands/xmlupload/resource_multimedia.py +++ b/src/dsp_tools/commands/xmlupload/resource_multimedia.py @@ -6,7 +6,8 @@ from dsp_tools.commands.xmlupload.models.permission import Permissions from dsp_tools.commands.xmlupload.models.sipi import Sipi from dsp_tools.commands.xmlupload.models.xmlbitstream import XMLBitstream -from dsp_tools.commands.xmlupload.models.xmlresource import BitstreamInfo, XMLResource +from dsp_tools.commands.xmlupload.models.xmlresource import BitstreamInfo +from dsp_tools.commands.xmlupload.models.xmlresource import XMLResource from dsp_tools.models.exceptions import PermanentConnectionError from dsp_tools.utils.create_logger import get_logger diff --git a/src/dsp_tools/commands/xmlupload/stash/construct_and_analyze_graph.py b/src/dsp_tools/commands/xmlupload/stash/construct_and_analyze_graph.py index 2d699892a..3a5b28ebb 100644 --- a/src/dsp_tools/commands/xmlupload/stash/construct_and_analyze_graph.py +++ b/src/dsp_tools/commands/xmlupload/stash/construct_and_analyze_graph.py @@ -1,12 +1,16 @@ from __future__ import annotations -from typing import Any, cast +from typing import Any +from typing import cast import regex import rustworkx as rx from lxml import etree -from dsp_tools.commands.xmlupload.stash.graph_models import Cost, Edge, ResptrLink, XMLLink +from dsp_tools.commands.xmlupload.stash.graph_models import Cost +from dsp_tools.commands.xmlupload.stash.graph_models import Edge +from dsp_tools.commands.xmlupload.stash.graph_models import ResptrLink +from dsp_tools.commands.xmlupload.stash.graph_models import XMLLink from dsp_tools.utils.iri_util import is_resource_iri diff --git a/src/dsp_tools/commands/xmlupload/stash/graph_models.py b/src/dsp_tools/commands/xmlupload/stash/graph_models.py index c50715c3d..6c52c53e7 100644 --- a/src/dsp_tools/commands/xmlupload/stash/graph_models.py +++ b/src/dsp_tools/commands/xmlupload/stash/graph_models.py @@ -1,7 +1,8 @@ from __future__ import annotations import uuid -from dataclasses import dataclass, field +from dataclasses import dataclass +from dataclasses import field @dataclass(frozen=True) diff --git a/src/dsp_tools/commands/xmlupload/stash/stash_circular_references.py b/src/dsp_tools/commands/xmlupload/stash/stash_circular_references.py index 1b94c2805..a0d5ac30a 100644 --- a/src/dsp_tools/commands/xmlupload/stash/stash_circular_references.py +++ b/src/dsp_tools/commands/xmlupload/stash/stash_circular_references.py @@ -9,18 +9,14 @@ from dsp_tools.commands.xmlupload.models.permission import Permissions from dsp_tools.commands.xmlupload.models.xmlproperty import XMLProperty from dsp_tools.commands.xmlupload.models.xmlresource import XMLResource -from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import ( - create_info_from_xml_for_graph, - generate_upload_order, - make_graph, -) -from dsp_tools.commands.xmlupload.stash.stash_models import ( - LinkValueStash, - LinkValueStashItem, - StandoffStash, - StandoffStashItem, - Stash, -) +from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import create_info_from_xml_for_graph +from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import generate_upload_order +from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import make_graph +from dsp_tools.commands.xmlupload.stash.stash_models import LinkValueStash +from dsp_tools.commands.xmlupload.stash.stash_models import LinkValueStashItem +from dsp_tools.commands.xmlupload.stash.stash_models import StandoffStash +from dsp_tools.commands.xmlupload.stash.stash_models import StandoffStashItem +from dsp_tools.commands.xmlupload.stash.stash_models import Stash from dsp_tools.utils.create_logger import get_logger logger = get_logger(__name__) diff --git a/src/dsp_tools/commands/xmlupload/stash/upload_stashed_resptr_props.py b/src/dsp_tools/commands/xmlupload/stash/upload_stashed_resptr_props.py index 97cfb3aa4..2170c57db 100644 --- a/src/dsp_tools/commands/xmlupload/stash/upload_stashed_resptr_props.py +++ b/src/dsp_tools/commands/xmlupload/stash/upload_stashed_resptr_props.py @@ -4,7 +4,8 @@ from typing import Any from dsp_tools.commands.xmlupload.iri_resolver import IriResolver -from dsp_tools.commands.xmlupload.stash.stash_models import LinkValueStash, LinkValueStashItem +from dsp_tools.commands.xmlupload.stash.stash_models import LinkValueStash +from dsp_tools.commands.xmlupload.stash.stash_models import LinkValueStashItem from dsp_tools.models.exceptions import BaseError from dsp_tools.utils.connection import Connection from dsp_tools.utils.create_logger import get_logger diff --git a/src/dsp_tools/commands/xmlupload/stash/upload_stashed_xml_texts.py b/src/dsp_tools/commands/xmlupload/stash/upload_stashed_xml_texts.py index 021fdbcdb..a990dc42b 100644 --- a/src/dsp_tools/commands/xmlupload/stash/upload_stashed_xml_texts.py +++ b/src/dsp_tools/commands/xmlupload/stash/upload_stashed_xml_texts.py @@ -6,7 +6,8 @@ from dsp_tools.commands.xmlupload.iri_resolver import IriResolver from dsp_tools.commands.xmlupload.models.formatted_text_value import FormattedTextValue -from dsp_tools.commands.xmlupload.stash.stash_models import StandoffStash, StandoffStashItem +from dsp_tools.commands.xmlupload.stash.stash_models import StandoffStash +from dsp_tools.commands.xmlupload.stash.stash_models import StandoffStashItem from dsp_tools.models.exceptions import BaseError from dsp_tools.utils.connection import Connection from dsp_tools.utils.create_logger import get_logger diff --git a/src/dsp_tools/commands/xmlupload/upload_config.py b/src/dsp_tools/commands/xmlupload/upload_config.py index 38775896a..c2d8b12ca 100644 --- a/src/dsp_tools/commands/xmlupload/upload_config.py +++ b/src/dsp_tools/commands/xmlupload/upload_config.py @@ -1,7 +1,8 @@ from __future__ import annotations import dataclasses -from dataclasses import dataclass, field +from dataclasses import dataclass +from dataclasses import field from datetime import datetime from pathlib import Path diff --git a/src/dsp_tools/commands/xmlupload/xmlupload.py b/src/dsp_tools/commands/xmlupload/xmlupload.py index 27fd3bf46..2d922461f 100644 --- a/src/dsp_tools/commands/xmlupload/xmlupload.py +++ b/src/dsp_tools/commands/xmlupload/xmlupload.py @@ -6,32 +6,36 @@ from datetime import datetime from logging import FileHandler from pathlib import Path -from typing import Any, Union +from typing import Any +from typing import Union from lxml import etree from dsp_tools.commands.xmlupload.check_consistency_with_ontology import do_xml_consistency_check_with_ontology from dsp_tools.commands.xmlupload.iri_resolver import IriResolver -from dsp_tools.commands.xmlupload.list_client import ListClient, ListClientLive +from dsp_tools.commands.xmlupload.list_client import ListClient +from dsp_tools.commands.xmlupload.list_client import ListClientLive from dsp_tools.commands.xmlupload.models.permission import Permissions from dsp_tools.commands.xmlupload.models.sipi import Sipi from dsp_tools.commands.xmlupload.models.xmlpermission import XmlPermission -from dsp_tools.commands.xmlupload.models.xmlresource import BitstreamInfo, XMLResource +from dsp_tools.commands.xmlupload.models.xmlresource import BitstreamInfo +from dsp_tools.commands.xmlupload.models.xmlresource import XMLResource from dsp_tools.commands.xmlupload.ontology_client import OntologyClientLive -from dsp_tools.commands.xmlupload.project_client import ProjectClient, ProjectClientLive +from dsp_tools.commands.xmlupload.project_client import ProjectClient +from dsp_tools.commands.xmlupload.project_client import ProjectClientLive from dsp_tools.commands.xmlupload.read_validate_xml_file import validate_and_parse_xml_file from dsp_tools.commands.xmlupload.resource_create_client import ResourceCreateClient from dsp_tools.commands.xmlupload.resource_multimedia import handle_media_info -from dsp_tools.commands.xmlupload.stash.stash_circular_references import ( - identify_circular_references, - stash_circular_references, -) +from dsp_tools.commands.xmlupload.stash.stash_circular_references import identify_circular_references +from dsp_tools.commands.xmlupload.stash.stash_circular_references import stash_circular_references from dsp_tools.commands.xmlupload.stash.stash_models import Stash from dsp_tools.commands.xmlupload.stash.upload_stashed_resptr_props import upload_stashed_resptr_props from dsp_tools.commands.xmlupload.stash.upload_stashed_xml_texts import upload_stashed_xml_texts -from dsp_tools.commands.xmlupload.upload_config import DiagnosticsConfig, UploadConfig +from dsp_tools.commands.xmlupload.upload_config import DiagnosticsConfig +from dsp_tools.commands.xmlupload.upload_config import UploadConfig from dsp_tools.commands.xmlupload.write_diagnostic_info import write_id2iri_mapping -from dsp_tools.models.exceptions import BaseError, UserError +from dsp_tools.models.exceptions import BaseError +from dsp_tools.models.exceptions import UserError from dsp_tools.models.projectContext import ProjectContext from dsp_tools.utils.connection import Connection from dsp_tools.utils.connection_live import ConnectionLive diff --git a/src/dsp_tools/models/datetimestamp.py b/src/dsp_tools/models/datetimestamp.py index dbde6c20d..0fc0336c5 100644 --- a/src/dsp_tools/models/datetimestamp.py +++ b/src/dsp_tools/models/datetimestamp.py @@ -1,6 +1,7 @@ from __future__ import annotations -from typing import Any, Union +from typing import Any +from typing import Union import regex diff --git a/src/dsp_tools/models/langstring.py b/src/dsp_tools/models/langstring.py index 5e12dafa7..1e67ae1b5 100644 --- a/src/dsp_tools/models/langstring.py +++ b/src/dsp_tools/models/langstring.py @@ -1,5 +1,8 @@ -from enum import Enum, unique -from typing import Any, Optional, Union +from enum import Enum +from enum import unique +from typing import Any +from typing import Optional +from typing import Union from dsp_tools.models.exceptions import BaseError diff --git a/src/dsp_tools/utils/connection.py b/src/dsp_tools/utils/connection.py index 8c7170e25..7ea471302 100644 --- a/src/dsp_tools/utils/connection.py +++ b/src/dsp_tools/utils/connection.py @@ -1,4 +1,5 @@ -from typing import Any, Protocol +from typing import Any +from typing import Protocol class Connection(Protocol): diff --git a/src/dsp_tools/utils/connection_live.py b/src/dsp_tools/utils/connection_live.py index 3cf0a08e5..b560b039f 100644 --- a/src/dsp_tools/utils/connection_live.py +++ b/src/dsp_tools/utils/connection_live.py @@ -1,17 +1,29 @@ import json import os import time -from dataclasses import dataclass, field +from dataclasses import dataclass +from dataclasses import field from datetime import datetime from functools import partial from importlib.metadata import version -from typing import Any, Literal, Optional, cast +from typing import Any +from typing import Literal +from typing import Optional +from typing import cast import regex -from requests import ReadTimeout, RequestException, Response, Session - -from dsp_tools.models.exceptions import BadCredentialsError, BaseError, InputError, PermanentConnectionError, UserError -from dsp_tools.utils.create_logger import get_log_filename_str, get_logger +from requests import ReadTimeout +from requests import RequestException +from requests import Response +from requests import Session + +from dsp_tools.models.exceptions import BadCredentialsError +from dsp_tools.models.exceptions import BaseError +from dsp_tools.models.exceptions import InputError +from dsp_tools.models.exceptions import PermanentConnectionError +from dsp_tools.models.exceptions import UserError +from dsp_tools.utils.create_logger import get_log_filename_str +from dsp_tools.utils.create_logger import get_logger from dsp_tools.utils.set_encoder import SetEncoder HTTP_OK = 200 diff --git a/src/dsp_tools/utils/set_encoder.py b/src/dsp_tools/utils/set_encoder.py index 6515f1377..68c56309a 100644 --- a/src/dsp_tools/utils/set_encoder.py +++ b/src/dsp_tools/utils/set_encoder.py @@ -1,5 +1,6 @@ import json -from typing import Any, Union +from typing import Any +from typing import Union from dsp_tools.commands.project.models.context import Context from dsp_tools.commands.project.models.helpers import OntoIri diff --git a/src/dsp_tools/utils/shared.py b/src/dsp_tools/utils/shared.py index 0dc45fc29..9dcf3acc5 100644 --- a/src/dsp_tools/utils/shared.py +++ b/src/dsp_tools/utils/shared.py @@ -3,7 +3,10 @@ import json import unicodedata from pathlib import Path -from typing import Any, Optional, TypeGuard, Union +from typing import Any +from typing import Optional +from typing import TypeGuard +from typing import Union import pandas as pd import regex diff --git a/src/dsp_tools/utils/xml_utils.py b/src/dsp_tools/utils/xml_utils.py index ee7e91afb..cb25d1cae 100644 --- a/src/dsp_tools/utils/xml_utils.py +++ b/src/dsp_tools/utils/xml_utils.py @@ -2,7 +2,8 @@ import copy from pathlib import Path -from typing import Any, Union +from typing import Any +from typing import Union from lxml import etree diff --git a/src/dsp_tools/utils/xml_validation.py b/src/dsp_tools/utils/xml_validation.py index c3db34db0..58c21e18a 100644 --- a/src/dsp_tools/utils/xml_validation.py +++ b/src/dsp_tools/utils/xml_validation.py @@ -3,18 +3,18 @@ import importlib.resources from datetime import datetime from pathlib import Path -from typing import Any, Union +from typing import Any +from typing import Union import regex from lxml import etree from dsp_tools.models.exceptions import InputError from dsp_tools.utils.create_logger import get_logger -from dsp_tools.utils.xml_utils import parse_and_remove_comments_from_xml_file, remove_namespaces_from_xml -from dsp_tools.utils.xml_validation_models import ( - InconsistentTextValueEncodings, - TextValueData, -) +from dsp_tools.utils.xml_utils import parse_and_remove_comments_from_xml_file +from dsp_tools.utils.xml_utils import remove_namespaces_from_xml +from dsp_tools.utils.xml_validation_models import InconsistentTextValueEncodings +from dsp_tools.utils.xml_validation_models import TextValueData logger = get_logger(__name__) diff --git a/test/benchmarking/test_stash_circular_references.py b/test/benchmarking/test_stash_circular_references.py index ac4e77ee9..b1f903008 100644 --- a/test/benchmarking/test_stash_circular_references.py +++ b/test/benchmarking/test_stash_circular_references.py @@ -2,10 +2,8 @@ from termcolor import cprint from dsp_tools.commands.xmlupload.models.permission import Permissions -from dsp_tools.commands.xmlupload.stash.stash_circular_references import ( - identify_circular_references, - stash_circular_references, -) +from dsp_tools.commands.xmlupload.stash.stash_circular_references import identify_circular_references +from dsp_tools.commands.xmlupload.stash.stash_circular_references import stash_circular_references from dsp_tools.commands.xmlupload.xmlupload import _extract_resources_from_xml from dsp_tools.utils.xml_utils import parse_and_clean_xml_file diff --git a/test/e2e/commands/project/test_group.py b/test/e2e/commands/project/test_group.py index 3acc7b237..1b2c3716f 100644 --- a/test/e2e/commands/project/test_group.py +++ b/test/e2e/commands/project/test_group.py @@ -5,7 +5,8 @@ import pytest from dsp_tools.commands.project.models.group import Group -from dsp_tools.models.langstring import LangString, Languages +from dsp_tools.models.langstring import LangString +from dsp_tools.models.langstring import Languages from dsp_tools.utils.connection import Connection from dsp_tools.utils.connection_live import ConnectionLive diff --git a/test/e2e/commands/project/test_listnode.py b/test/e2e/commands/project/test_listnode.py index dc461e57f..b3b75207a 100644 --- a/test/e2e/commands/project/test_listnode.py +++ b/test/e2e/commands/project/test_listnode.py @@ -4,7 +4,8 @@ import pytest from dsp_tools.commands.project.models.listnode import ListNode -from dsp_tools.models.langstring import LangString, Languages +from dsp_tools.models.langstring import LangString +from dsp_tools.models.langstring import Languages from dsp_tools.utils.connection import Connection from dsp_tools.utils.connection_live import ConnectionLive diff --git a/test/e2e/commands/project/test_propertyclass.py b/test/e2e/commands/project/test_propertyclass.py index f6ffc16dc..7accbcc0f 100644 --- a/test/e2e/commands/project/test_propertyclass.py +++ b/test/e2e/commands/project/test_propertyclass.py @@ -2,7 +2,8 @@ from dsp_tools.commands.project.models.ontology import Ontology from dsp_tools.commands.project.models.propertyclass import PropertyClass -from dsp_tools.models.langstring import LangString, Languages +from dsp_tools.models.langstring import LangString +from dsp_tools.models.langstring import Languages from dsp_tools.utils.connection_live import ConnectionLive diff --git a/test/e2e/commands/project/test_resourceclass.py b/test/e2e/commands/project/test_resourceclass.py index 81c051281..4b50554a6 100644 --- a/test/e2e/commands/project/test_resourceclass.py +++ b/test/e2e/commands/project/test_resourceclass.py @@ -6,7 +6,8 @@ from dsp_tools.commands.project.models.ontology import Ontology from dsp_tools.commands.project.models.resourceclass import ResourceClass -from dsp_tools.models.langstring import LangString, Languages +from dsp_tools.models.langstring import LangString +from dsp_tools.models.langstring import Languages from dsp_tools.utils.connection import Connection from dsp_tools.utils.connection_live import ConnectionLive diff --git a/test/e2e/commands/test_create_get_xmlupload.py b/test/e2e/commands/test_create_get_xmlupload.py index 5ec51f942..3096c2e13 100644 --- a/test/e2e/commands/test_create_get_xmlupload.py +++ b/test/e2e/commands/test_create_get_xmlupload.py @@ -3,7 +3,10 @@ import shutil import unittest from pathlib import Path -from typing import Any, Optional, Union, cast +from typing import Any +from typing import Optional +from typing import Union +from typing import cast import regex diff --git a/test/e2e/commands/xmlupload/test_project_client_live.py b/test/e2e/commands/xmlupload/test_project_client_live.py index 0b923484b..39054fd6f 100644 --- a/test/e2e/commands/xmlupload/test_project_client_live.py +++ b/test/e2e/commands/xmlupload/test_project_client_live.py @@ -1,6 +1,7 @@ import pytest -from dsp_tools.commands.xmlupload.project_client import ProjectClient, ProjectClientLive +from dsp_tools.commands.xmlupload.project_client import ProjectClient +from dsp_tools.commands.xmlupload.project_client import ProjectClientLive from dsp_tools.utils.connection_live import ConnectionLive diff --git a/test/unittests/cli/test_cli_with_mock.py b/test/unittests/cli/test_cli_with_mock.py index 6bdc008a9..e1cda53b1 100644 --- a/test/unittests/cli/test_cli_with_mock.py +++ b/test/unittests/cli/test_cli_with_mock.py @@ -1,4 +1,5 @@ -from unittest.mock import Mock, patch +from unittest.mock import Mock +from unittest.mock import patch import pytest diff --git a/test/unittests/cli/test_helper_functions.py b/test/unittests/cli/test_helper_functions.py index 525675887..ff7761012 100644 --- a/test/unittests/cli/test_helper_functions.py +++ b/test/unittests/cli/test_helper_functions.py @@ -5,7 +5,8 @@ import pytest -from dsp_tools.cli.entry_point import _derive_sipi_url, _get_canonical_server_and_sipi_url +from dsp_tools.cli.entry_point import _derive_sipi_url +from dsp_tools.cli.entry_point import _get_canonical_server_and_sipi_url from dsp_tools.models.exceptions import UserError # ruff: noqa: PT009 (pytest-unittest-assertion) (remove this line when pytest is used instead of unittest) diff --git a/test/unittests/commands/excel2json/test_project.py b/test/unittests/commands/excel2json/test_project.py index 87b302ee3..827be7b56 100644 --- a/test/unittests/commands/excel2json/test_project.py +++ b/test/unittests/commands/excel2json/test_project.py @@ -3,7 +3,8 @@ import pytest -from dsp_tools.commands.excel2json.project import _create_project_json, _validate_folder_structure_get_filenames +from dsp_tools.commands.excel2json.project import _create_project_json +from dsp_tools.commands.excel2json.project import _validate_folder_structure_get_filenames # ruff: noqa: PT009 (pytest-unittest-assertion) (remove this line when pytest is used instead of unittest) diff --git a/test/unittests/commands/excel2json/test_properties.py b/test/unittests/commands/excel2json/test_properties.py index 298768905..bffbd1ba8 100644 --- a/test/unittests/commands/excel2json/test_properties.py +++ b/test/unittests/commands/excel2json/test_properties.py @@ -2,7 +2,8 @@ import re import unittest -from typing import Any, cast +from typing import Any +from typing import cast import jsonpath_ng import jsonpath_ng.ext diff --git a/test/unittests/commands/excel2json/test_resources_high_level.py b/test/unittests/commands/excel2json/test_resources_high_level.py index 4724a3ae0..59ee53d27 100644 --- a/test/unittests/commands/excel2json/test_resources_high_level.py +++ b/test/unittests/commands/excel2json/test_resources_high_level.py @@ -7,7 +7,8 @@ from pytest_unordered import unordered from dsp_tools.commands.excel2json import resources as e2j -from dsp_tools.models.exceptions import BaseError, InputError +from dsp_tools.models.exceptions import BaseError +from dsp_tools.models.exceptions import InputError # ruff: noqa: PT009 (pytest-unittest-assertion) (remove this line when pytest is used instead of unittest) diff --git a/test/unittests/commands/excel2json/test_utils.py b/test/unittests/commands/excel2json/test_utils.py index 21f34cacb..7507a1a55 100644 --- a/test/unittests/commands/excel2json/test_utils.py +++ b/test/unittests/commands/excel2json/test_utils.py @@ -3,7 +3,8 @@ import pandas as pd import pytest -from pandas.testing import assert_frame_equal, assert_series_equal +from pandas.testing import assert_frame_equal +from pandas.testing import assert_series_equal from pytest_unordered import unordered import dsp_tools.commands.excel2json.utils as utl diff --git a/test/unittests/commands/excel2xml/test_excel2xml_lib.py b/test/unittests/commands/excel2xml/test_excel2xml_lib.py index d3c83086b..db6cd3ff0 100644 --- a/test/unittests/commands/excel2xml/test_excel2xml_lib.py +++ b/test/unittests/commands/excel2xml/test_excel2xml_lib.py @@ -2,7 +2,11 @@ import unittest import warnings from pathlib import Path -from typing import Any, Callable, Optional, Sequence, Union +from typing import Any +from typing import Callable +from typing import Optional +from typing import Sequence +from typing import Union import numpy as np import pandas as pd diff --git a/test/unittests/commands/project/test_create_project.py b/test/unittests/commands/project/test_create_project.py index 5955870d2..572442f30 100644 --- a/test/unittests/commands/project/test_create_project.py +++ b/test/unittests/commands/project/test_create_project.py @@ -4,21 +4,18 @@ import pytest from pytest_unordered import unordered -from dsp_tools.commands.project.create.project_create import ( - _rectify_hlist_of_properties, - _sort_prop_classes, - _sort_resources, -) -from dsp_tools.commands.project.create.project_validate import ( - _check_for_duplicate_names, - _check_for_undefined_cardinalities, - _check_for_undefined_super_property, - _check_for_undefined_super_resource, - _collect_link_properties, - _identify_problematic_cardinalities, - validate_project, -) -from dsp_tools.models.exceptions import BaseError, UserError +from dsp_tools.commands.project.create.project_create import _rectify_hlist_of_properties +from dsp_tools.commands.project.create.project_create import _sort_prop_classes +from dsp_tools.commands.project.create.project_create import _sort_resources +from dsp_tools.commands.project.create.project_validate import _check_for_duplicate_names +from dsp_tools.commands.project.create.project_validate import _check_for_undefined_cardinalities +from dsp_tools.commands.project.create.project_validate import _check_for_undefined_super_property +from dsp_tools.commands.project.create.project_validate import _check_for_undefined_super_resource +from dsp_tools.commands.project.create.project_validate import _collect_link_properties +from dsp_tools.commands.project.create.project_validate import _identify_problematic_cardinalities +from dsp_tools.commands.project.create.project_validate import validate_project +from dsp_tools.models.exceptions import BaseError +from dsp_tools.models.exceptions import UserError from dsp_tools.utils.shared import parse_json_input diff --git a/test/unittests/commands/project/test_models_project.py b/test/unittests/commands/project/test_models_project.py index 783cbd4d6..01aae0fdd 100644 --- a/test/unittests/commands/project/test_models_project.py +++ b/test/unittests/commands/project/test_models_project.py @@ -3,7 +3,8 @@ import pytest from dsp_tools.commands.project.models.project import Project -from dsp_tools.models.langstring import LangString, Languages +from dsp_tools.models.langstring import LangString +from dsp_tools.models.langstring import Languages @pytest.fixture() diff --git a/test/unittests/commands/test_id2iri.py b/test/unittests/commands/test_id2iri.py index 7599632c0..8883cbca9 100644 --- a/test/unittests/commands/test_id2iri.py +++ b/test/unittests/commands/test_id2iri.py @@ -4,7 +4,9 @@ import regex from lxml import etree -from dsp_tools.commands.id2iri import _remove_resources_if_id_in_mapping, _replace_ids_by_iris, id2iri +from dsp_tools.commands.id2iri import _remove_resources_if_id_in_mapping +from dsp_tools.commands.id2iri import _replace_ids_by_iris +from dsp_tools.commands.id2iri import id2iri from dsp_tools.models.exceptions import BaseError diff --git a/test/unittests/commands/xmlupload/stash/test_construct_and_analyze_graph.py b/test/unittests/commands/xmlupload/stash/test_construct_and_analyze_graph.py index d0be452d8..d37c5d684 100644 --- a/test/unittests/commands/xmlupload/stash/test_construct_and_analyze_graph.py +++ b/test/unittests/commands/xmlupload/stash/test_construct_and_analyze_graph.py @@ -5,21 +5,23 @@ from lxml import etree from pytest_unordered import unordered +from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import _add_stash_to_lookup_dict from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import ( - _add_stash_to_lookup_dict, _create_info_from_xml_for_graph_from_one_resource, - _create_resptr_link_objects, - _create_text_link_objects, - _extract_ids_from_one_text_value, - _find_cheapest_outgoing_links, - _find_phantom_xml_edges, - _remove_edges_to_stash, - _remove_leaf_nodes, - create_info_from_xml_for_graph, - generate_upload_order, - make_graph, ) -from dsp_tools.commands.xmlupload.stash.graph_models import Edge, ResptrLink, XMLLink +from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import _create_resptr_link_objects +from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import _create_text_link_objects +from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import _extract_ids_from_one_text_value +from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import _find_cheapest_outgoing_links +from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import _find_phantom_xml_edges +from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import _remove_edges_to_stash +from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import _remove_leaf_nodes +from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import create_info_from_xml_for_graph +from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import generate_upload_order +from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import make_graph +from dsp_tools.commands.xmlupload.stash.graph_models import Edge +from dsp_tools.commands.xmlupload.stash.graph_models import ResptrLink +from dsp_tools.commands.xmlupload.stash.graph_models import XMLLink def test_create_info_from_xml_for_graph_from_one_resource() -> None: diff --git a/test/unittests/commands/xmlupload/stash/test_upload_stash_with_mock.py b/test/unittests/commands/xmlupload/stash/test_upload_stash_with_mock.py index f834f2090..643b2792b 100644 --- a/test/unittests/commands/xmlupload/stash/test_upload_stash_with_mock.py +++ b/test/unittests/commands/xmlupload/stash/test_upload_stash_with_mock.py @@ -1,17 +1,16 @@ -from dataclasses import dataclass, field +from dataclasses import dataclass +from dataclasses import field from test.unittests.commands.xmlupload.connection_mock import ConnectionMockBase from typing import Any from uuid import uuid4 from dsp_tools.commands.xmlupload.iri_resolver import IriResolver from dsp_tools.commands.xmlupload.models.formatted_text_value import FormattedTextValue -from dsp_tools.commands.xmlupload.stash.stash_models import ( - LinkValueStash, - LinkValueStashItem, - StandoffStash, - StandoffStashItem, - Stash, -) +from dsp_tools.commands.xmlupload.stash.stash_models import LinkValueStash +from dsp_tools.commands.xmlupload.stash.stash_models import LinkValueStashItem +from dsp_tools.commands.xmlupload.stash.stash_models import StandoffStash +from dsp_tools.commands.xmlupload.stash.stash_models import StandoffStashItem +from dsp_tools.commands.xmlupload.stash.stash_models import Stash from dsp_tools.commands.xmlupload.xmlupload import _upload_stash from dsp_tools.utils.connection import Connection diff --git a/test/unittests/commands/xmlupload/test_check_consistency_with_ontology_high_level.py b/test/unittests/commands/xmlupload/test_check_consistency_with_ontology_high_level.py index 6eeb0ce7e..944e21427 100644 --- a/test/unittests/commands/xmlupload/test_check_consistency_with_ontology_high_level.py +++ b/test/unittests/commands/xmlupload/test_check_consistency_with_ontology_high_level.py @@ -8,7 +8,9 @@ from dsp_tools.commands.xmlupload.check_consistency_with_ontology import do_xml_consistency_check_with_ontology from dsp_tools.commands.xmlupload.ontology_client import OntologyClientLive -from dsp_tools.models.exceptions import BaseError, InputError, UserError +from dsp_tools.models.exceptions import BaseError +from dsp_tools.models.exceptions import InputError +from dsp_tools.models.exceptions import UserError @dataclass diff --git a/test/unittests/commands/xmlupload/test_check_consistency_with_ontology_low_level.py b/test/unittests/commands/xmlupload/test_check_consistency_with_ontology_low_level.py index 81298ff34..f26400cfa 100644 --- a/test/unittests/commands/xmlupload/test_check_consistency_with_ontology_low_level.py +++ b/test/unittests/commands/xmlupload/test_check_consistency_with_ontology_low_level.py @@ -2,28 +2,30 @@ from lxml import etree from pytest_unordered import unordered +from dsp_tools.commands.xmlupload.check_consistency_with_ontology import _check_all_classes_and_properties_in_onto +from dsp_tools.commands.xmlupload.check_consistency_with_ontology import _check_correctness_all_text_value_encodings +from dsp_tools.commands.xmlupload.check_consistency_with_ontology import _check_correctness_of_one_prop +from dsp_tools.commands.xmlupload.check_consistency_with_ontology import _find_all_class_types_in_onto +from dsp_tools.commands.xmlupload.check_consistency_with_ontology import _find_all_properties_in_onto +from dsp_tools.commands.xmlupload.check_consistency_with_ontology import _find_one_class_type_in_onto +from dsp_tools.commands.xmlupload.check_consistency_with_ontology import _find_one_property_in_onto +from dsp_tools.commands.xmlupload.check_consistency_with_ontology import _get_all_class_types_and_ids_from_data +from dsp_tools.commands.xmlupload.check_consistency_with_ontology import _get_all_classes_and_properties_from_data +from dsp_tools.commands.xmlupload.check_consistency_with_ontology import _get_all_ids_and_props_and_encodings_from_root from dsp_tools.commands.xmlupload.check_consistency_with_ontology import ( - _check_all_classes_and_properties_in_onto, - _check_correctness_all_text_value_encodings, - _check_correctness_of_one_prop, - _find_all_class_types_in_onto, - _find_all_properties_in_onto, - _find_one_class_type_in_onto, - _find_one_property_in_onto, - _get_all_class_types_and_ids_from_data, - _get_all_classes_and_properties_from_data, - _get_all_ids_and_props_and_encodings_from_root, _get_all_property_names_and_resource_ids_one_resource, +) +from dsp_tools.commands.xmlupload.check_consistency_with_ontology import ( _get_id_and_props_and_encodings_from_one_resource, - _get_prop_and_encoding_from_one_property, - _get_separate_prefix_and_iri_from_onto_prop_or_cls, ) -from dsp_tools.commands.xmlupload.models.ontology_lookup_models import ( - OntoInfo, - ProjectOntosInformation, - PropertyTextValueTypes, - TextValueData, +from dsp_tools.commands.xmlupload.check_consistency_with_ontology import _get_prop_and_encoding_from_one_property +from dsp_tools.commands.xmlupload.check_consistency_with_ontology import ( + _get_separate_prefix_and_iri_from_onto_prop_or_cls, ) +from dsp_tools.commands.xmlupload.models.ontology_lookup_models import OntoInfo +from dsp_tools.commands.xmlupload.models.ontology_lookup_models import ProjectOntosInformation +from dsp_tools.commands.xmlupload.models.ontology_lookup_models import PropertyTextValueTypes +from dsp_tools.commands.xmlupload.models.ontology_lookup_models import TextValueData class TestFindClassType: diff --git a/test/unittests/commands/xmlupload/test_list_client_live.py b/test/unittests/commands/xmlupload/test_list_client_live.py index e45213cb6..9f8f3850a 100644 --- a/test/unittests/commands/xmlupload/test_list_client_live.py +++ b/test/unittests/commands/xmlupload/test_list_client_live.py @@ -4,13 +4,11 @@ import pytest -from dsp_tools.commands.xmlupload.list_client import ( - List, - ListClientLive, - ListNode, - _get_list_from_server, - _get_list_iris_from_server, -) +from dsp_tools.commands.xmlupload.list_client import List +from dsp_tools.commands.xmlupload.list_client import ListClientLive +from dsp_tools.commands.xmlupload.list_client import ListNode +from dsp_tools.commands.xmlupload.list_client import _get_list_from_server +from dsp_tools.commands.xmlupload.list_client import _get_list_iris_from_server @dataclass diff --git a/test/unittests/commands/xmlupload/test_ontology_client.py b/test/unittests/commands/xmlupload/test_ontology_client.py index 8dcbc8437..83b49c61d 100644 --- a/test/unittests/commands/xmlupload/test_ontology_client.py +++ b/test/unittests/commands/xmlupload/test_ontology_client.py @@ -5,9 +5,7 @@ import pytest from pytest_unordered import unordered -from dsp_tools.commands.xmlupload.ontology_client import ( - OntologyClientLive, -) +from dsp_tools.commands.xmlupload.ontology_client import OntologyClientLive @dataclass diff --git a/test/unittests/commands/xmlupload/test_ontology_lookup_models.py b/test/unittests/commands/xmlupload/test_ontology_lookup_models.py index cb215f0fb..f00a05a1d 100644 --- a/test/unittests/commands/xmlupload/test_ontology_lookup_models.py +++ b/test/unittests/commands/xmlupload/test_ontology_lookup_models.py @@ -1,16 +1,16 @@ import pytest from pytest_unordered import unordered +from dsp_tools.commands.xmlupload.models.ontology_lookup_models import _check_if_text_value_property +from dsp_tools.commands.xmlupload.models.ontology_lookup_models import _extract_classes_and_properties_from_onto +from dsp_tools.commands.xmlupload.models.ontology_lookup_models import _get_all_classes_from_onto +from dsp_tools.commands.xmlupload.models.ontology_lookup_models import _get_all_properties_from_onto from dsp_tools.commands.xmlupload.models.ontology_lookup_models import ( - _check_if_text_value_property, - _extract_classes_and_properties_from_onto, - _get_all_classes_from_onto, - _get_all_properties_from_onto, _get_all_text_value_types_properties_and_from_onto, - _make_text_value_property_type_lookup, - _remove_default_prefix, - _remove_prefixes, ) +from dsp_tools.commands.xmlupload.models.ontology_lookup_models import _make_text_value_property_type_lookup +from dsp_tools.commands.xmlupload.models.ontology_lookup_models import _remove_default_prefix +from dsp_tools.commands.xmlupload.models.ontology_lookup_models import _remove_prefixes class TestGetAllClassesFromJson: diff --git a/test/unittests/commands/xmlupload/test_ontology_problem_models.py b/test/unittests/commands/xmlupload/test_ontology_problem_models.py index 4241b7345..aa0a79829 100644 --- a/test/unittests/commands/xmlupload/test_ontology_problem_models.py +++ b/test/unittests/commands/xmlupload/test_ontology_problem_models.py @@ -2,12 +2,10 @@ from pandas.testing import assert_frame_equal from dsp_tools.commands.xmlupload.models.ontology_lookup_models import TextValueData -from dsp_tools.commands.xmlupload.models.ontology_problem_models import ( - InvalidOntologyElementsInData, - InvalidTextValueEncodings, - _make_msg_for_one_resource, - _make_msg_from_df, -) +from dsp_tools.commands.xmlupload.models.ontology_problem_models import InvalidOntologyElementsInData +from dsp_tools.commands.xmlupload.models.ontology_problem_models import InvalidTextValueEncodings +from dsp_tools.commands.xmlupload.models.ontology_problem_models import _make_msg_for_one_resource +from dsp_tools.commands.xmlupload.models.ontology_problem_models import _make_msg_from_df class TestInvalidOntologyElementsInData: diff --git a/test/unittests/commands/xmlupload/test_project_client_live.py b/test/unittests/commands/xmlupload/test_project_client_live.py index d0eada4e0..970215100 100644 --- a/test/unittests/commands/xmlupload/test_project_client_live.py +++ b/test/unittests/commands/xmlupload/test_project_client_live.py @@ -1,4 +1,5 @@ -from dataclasses import dataclass, field +from dataclasses import dataclass +from dataclasses import field from test.unittests.commands.xmlupload.connection_mock import ConnectionMockBase from typing import Any diff --git a/test/unittests/commands/xmlupload/test_read_validate_xml_file.py b/test/unittests/commands/xmlupload/test_read_validate_xml_file.py index 1322c819e..a4d29cb05 100644 --- a/test/unittests/commands/xmlupload/test_read_validate_xml_file.py +++ b/test/unittests/commands/xmlupload/test_read_validate_xml_file.py @@ -1,10 +1,8 @@ import pytest from lxml import etree -from dsp_tools.commands.xmlupload.read_validate_xml_file import ( - _check_if_resptr_targets_exist, - _check_if_salsah_targets_exist, -) +from dsp_tools.commands.xmlupload.read_validate_xml_file import _check_if_resptr_targets_exist +from dsp_tools.commands.xmlupload.read_validate_xml_file import _check_if_salsah_targets_exist def test_check_if_resptr_targets_exist() -> None: diff --git a/test/unittests/commands/xmlupload/test_resource_create_client.py b/test/unittests/commands/xmlupload/test_resource_create_client.py index 1cd902258..8c57add87 100644 --- a/test/unittests/commands/xmlupload/test_resource_create_client.py +++ b/test/unittests/commands/xmlupload/test_resource_create_client.py @@ -1,8 +1,10 @@ import pytest -from dsp_tools.commands.xmlupload.models.permission import Permissions, PermissionValue +from dsp_tools.commands.xmlupload.models.permission import Permissions +from dsp_tools.commands.xmlupload.models.permission import PermissionValue from dsp_tools.commands.xmlupload.models.xmlresource import BitstreamInfo -from dsp_tools.commands.xmlupload.resource_create_client import _make_bitstream_file_value, _to_boolean +from dsp_tools.commands.xmlupload.resource_create_client import _make_bitstream_file_value +from dsp_tools.commands.xmlupload.resource_create_client import _to_boolean from dsp_tools.models.exceptions import BaseError diff --git a/test/unittests/commands/xmlupload/test_upload_config.py b/test/unittests/commands/xmlupload/test_upload_config.py index 786421a46..624284355 100644 --- a/test/unittests/commands/xmlupload/test_upload_config.py +++ b/test/unittests/commands/xmlupload/test_upload_config.py @@ -1,6 +1,7 @@ import pytest -from dsp_tools.commands.xmlupload.upload_config import UploadConfig, _transform_server_url_to_foldername +from dsp_tools.commands.xmlupload.upload_config import UploadConfig +from dsp_tools.commands.xmlupload.upload_config import _transform_server_url_to_foldername class TestTransformServerUrlToFoldername: diff --git a/test/unittests/models/test_langstring.py b/test/unittests/models/test_langstring.py index 72c469000..60ca7b630 100644 --- a/test/unittests/models/test_langstring.py +++ b/test/unittests/models/test_langstring.py @@ -3,7 +3,8 @@ import pytest -from dsp_tools.models.langstring import LangString, Languages +from dsp_tools.models.langstring import LangString +from dsp_tools.models.langstring import Languages # ruff: noqa: PT009 (pytest-unittest-assertion) (remove this line when pytest is used instead of unittest) diff --git a/test/unittests/utils/test_connection_live.py b/test/unittests/utils/test_connection_live.py index a19b0f644..c0369bbc7 100644 --- a/test/unittests/utils/test_connection_live.py +++ b/test/unittests/utils/test_connection_live.py @@ -3,14 +3,20 @@ import json from dataclasses import dataclass from importlib.metadata import version -from typing import Any, Callable, cast -from unittest.mock import Mock, patch +from typing import Any +from typing import Callable +from typing import cast +from unittest.mock import Mock +from unittest.mock import patch import pytest -from requests import ReadTimeout, RequestException +from requests import ReadTimeout +from requests import RequestException -from dsp_tools.models.exceptions import PermanentConnectionError, UserError -from dsp_tools.utils.connection_live import ConnectionLive, RequestParameters +from dsp_tools.models.exceptions import PermanentConnectionError +from dsp_tools.models.exceptions import UserError +from dsp_tools.utils.connection_live import ConnectionLive +from dsp_tools.utils.connection_live import RequestParameters @dataclass diff --git a/test/unittests/utils/test_date_util.py b/test/unittests/utils/test_date_util.py index b0d5f4a7c..55fc70492 100644 --- a/test/unittests/utils/test_date_util.py +++ b/test/unittests/utils/test_date_util.py @@ -1,15 +1,13 @@ import pytest from dsp_tools.models.exceptions import BaseError -from dsp_tools.utils.date_util import ( - Calendar, - Date, - Era, - SingleDate, - _parse_single_date, - _split_date_string, - parse_date_string, -) +from dsp_tools.utils.date_util import Calendar +from dsp_tools.utils.date_util import Date +from dsp_tools.utils.date_util import Era +from dsp_tools.utils.date_util import SingleDate +from dsp_tools.utils.date_util import _parse_single_date +from dsp_tools.utils.date_util import _split_date_string +from dsp_tools.utils.date_util import parse_date_string class TestParseDateStringWithDateOnly: diff --git a/test/unittests/utils/test_json_ld_util.py b/test/unittests/utils/test_json_ld_util.py index d615a0022..9d3923af0 100644 --- a/test/unittests/utils/test_json_ld_util.py +++ b/test/unittests/utils/test_json_ld_util.py @@ -1,6 +1,7 @@ import pytest -from dsp_tools.utils.json_ld_util import get_default_json_ld_context, get_json_ld_context_for_project +from dsp_tools.utils.json_ld_util import get_default_json_ld_context +from dsp_tools.utils.json_ld_util import get_json_ld_context_for_project def test_get_default_context() -> None: diff --git a/test/unittests/utils/test_xml_validation_low_level.py b/test/unittests/utils/test_xml_validation_low_level.py index 747b79026..680cfdb6a 100644 --- a/test/unittests/utils/test_xml_validation_low_level.py +++ b/test/unittests/utils/test_xml_validation_low_level.py @@ -1,14 +1,12 @@ import pytest from lxml import etree -from dsp_tools.utils.xml_validation import ( - _find_all_text_props_with_multiple_encodings, - _find_xml_tags_in_simple_text_elements, - _get_all_ids_and_encodings_from_root, - _get_encodings_from_one_property, - _get_encodings_from_one_resource, - check_if_only_one_encoding_is_used_per_prop_in_root, -) +from dsp_tools.utils.xml_validation import _find_all_text_props_with_multiple_encodings +from dsp_tools.utils.xml_validation import _find_xml_tags_in_simple_text_elements +from dsp_tools.utils.xml_validation import _get_all_ids_and_encodings_from_root +from dsp_tools.utils.xml_validation import _get_encodings_from_one_property +from dsp_tools.utils.xml_validation import _get_encodings_from_one_resource +from dsp_tools.utils.xml_validation import check_if_only_one_encoding_is_used_per_prop_in_root from dsp_tools.utils.xml_validation_models import TextValueData diff --git a/test/unittests/utils/test_xml_validation_models.py b/test/unittests/utils/test_xml_validation_models.py index 0a5b1d908..73f2a41d2 100644 --- a/test/unittests/utils/test_xml_validation_models.py +++ b/test/unittests/utils/test_xml_validation_models.py @@ -2,12 +2,10 @@ import pytest from pandas.testing import assert_frame_equal -from dsp_tools.utils.xml_validation_models import ( - InconsistentTextValueEncodings, - TextValueData, - _make_msg_for_one_resource, - _make_msg_from_df, -) +from dsp_tools.utils.xml_validation_models import InconsistentTextValueEncodings +from dsp_tools.utils.xml_validation_models import TextValueData +from dsp_tools.utils.xml_validation_models import _make_msg_for_one_resource +from dsp_tools.utils.xml_validation_models import _make_msg_from_df class TestInvalidTextValueEncodings: diff --git a/testdata/xml-data/circular-references/analyse_circles_in_xml.py b/testdata/xml-data/circular-references/analyse_circles_in_xml.py index 34dc47fb3..a14f696ca 100644 --- a/testdata/xml-data/circular-references/analyse_circles_in_xml.py +++ b/testdata/xml-data/circular-references/analyse_circles_in_xml.py @@ -3,11 +3,9 @@ from viztracer import VizTracer -from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import ( - create_info_from_xml_for_graph, - generate_upload_order, - make_graph, -) +from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import create_info_from_xml_for_graph +from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import generate_upload_order +from dsp_tools.commands.xmlupload.stash.construct_and_analyze_graph import make_graph from dsp_tools.utils.xml_utils import parse_and_clean_xml_file