Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Enable the isort rules for ruff and fix linting issues (#3698)
Staci Mullins9b4f727d87e0
diff --git a/api/api/views/audio_views.py b/api/api/views/audio_views.pyindex dcde7266b..9960ddb52 100644--- a/api/api/views/audio_views.py+++ b/api/api/views/audio_views.py@@ -15,9 +15,9 @@ from api.docs.audio_docs import (source_collection,stats,tag_collection,+ waveform,)from api.docs.audio_docs import thumbnail as thumbnail_docs-from api.docs.audio_docs import waveformfrom api.models import Audiofrom api.serializers.audio_serializers import (AudioCollectionRequestSerializer,diff --git a/api/conf/settings/security.py b/api/conf/settings/security.pyindex a5159b9b7..b2e26c64b 100644--- a/api/conf/settings/security.py+++ b/api/conf/settings/security.py@@ -1,10 +1,10 @@from socket import gethostbyname, gethostname-from decouple import config+from django.core.exceptions import ImproperlyConfigured-from conf.settings.base import INSTALLED_APPS, MIDDLEWARE, ENVIRONMENT+from decouple import config-from django.core.exceptions import ImproperlyConfigured+from conf.settings.base import ENVIRONMENT, INSTALLED_APPS, MIDDLEWARE# Quick-start development settings - unsuitable for productiondiff --git a/api/test/factory/models/audio.py b/api/test/factory/models/audio.pyindex 9735b2c2c..7f0ca49a7 100644--- a/api/test/factory/models/audio.py+++ b/api/test/factory/models/audio.py@@ -1,10 +1,9 @@-from test.factory.faker import Faker-from test.factory.models.media import IdentifierFactory, MediaFactory-import factoryfrom factory.django import DjangoModelFactoryfrom api.models.audio import Audio, AudioAddOn, AudioReport, MatureAudio+from test.factory.faker import Faker+from test.factory.models.media import IdentifierFactory, MediaFactoryclass MatureAudioFactory(DjangoModelFactory):diff --git a/api/test/factory/models/image.py b/api/test/factory/models/image.pyindex dc034ed3d..e0758b6a6 100644--- a/api/test/factory/models/image.py+++ b/api/test/factory/models/image.py@@ -1,9 +1,8 @@-from test.factory.models.media import MediaFactory, MediaReportFactory-import factoryfrom factory.django import DjangoModelFactoryfrom api.models.image import Image, ImageReport, MatureImage+from test.factory.models.media import MediaFactory, MediaReportFactoryclass MatureImageFactory(DjangoModelFactory):diff --git a/api/test/factory/models/media.py b/api/test/factory/models/media.pyindex 2df54763b..a6e451fa8 100644--- a/api/test/factory/models/media.py+++ b/api/test/factory/models/media.py@@ -1,4 +1,3 @@-from test.factory.faker import Fakerfrom uuid import uuid4from django.conf import settings@@ -11,6 +10,7 @@ from factory.django import DjangoModelFactoryfrom api.constants.licenses import ALL_LICENSESfrom api.models.media import AbstractMedia+from test.factory.faker import FakerCREATED_BY_FIXTURE_MARKER = "__created_by_test_fixture"diff --git a/api/test/factory/models/oauth2.py b/api/test/factory/models/oauth2.pyindex 6a749654e..22b3a6974 100644--- a/api/test/factory/models/oauth2.py+++ b/api/test/factory/models/oauth2.py@@ -1,5 +1,3 @@-from test.factory.faker import Faker-from django.utils import timezoneimport factory@@ -11,6 +9,7 @@ from api.models.oauth import (OAuth2Verification,ThrottledApplication,)+from test.factory.faker import Fakerclass ThrottledApplicationFactory(DjangoModelFactory):diff --git a/api/test/media_integration.py b/api/test/media_integration.pyindex 0a4563344..34b232897 100644--- a/api/test/media_integration.py+++ b/api/test/media_integration.py@@ -6,10 +6,11 @@ These are not tests and cannot be invoked.import jsonimport re-from test.constants import API_URLimport requests+from test.constants import API_URL+def search(fixture):"""Return results for test query."""diff --git a/api/test/test_audio_integration.py b/api/test/test_audio_integration.pyindex a172a1275..6bf1796d6 100644--- a/api/test/test_audio_integration.py+++ b/api/test/test_audio_integration.py@@ -6,6 +6,12 @@ Run with the `pytest -s` command from this directory."""import json++import pytest+import requests+from django_redis import get_redis_connection++from api.utils.check_dead_links import CACHE_PREFIXfrom test.constants import API_URLfrom test.media_integration import (creator_collection,@@ -28,12 +34,6 @@ from test.media_integration import (uuid_validation,)-import pytest-import requests-from django_redis import get_redis_connection--from api.utils.check_dead_links import CACHE_PREFIX-@pytest.fixturedef force_result_validity():diff --git a/api/test/test_auth.py b/api/test/test_auth.pyindex 117193bba..752c848fe 100644--- a/api/test/test_auth.py+++ b/api/test/test_auth.py@@ -1,6 +1,6 @@import timeimport uuid-from test.constants import API_URL+from unittest.mock import patchfrom django.urls import reversefrom django.utils.http import urlencode@@ -9,7 +9,8 @@ import pytestfrom oauth2_provider.models import AccessTokenfrom api.models import OAuth2Verification, ThrottledApplication-from unittest.mock import patch+from test.constants import API_URL+cache_availability_params = pytest.mark.parametrize("is_cache_reachable, cache_name",diff --git a/api/test/test_backwards_compat.py b/api/test/test_backwards_compat.pyindex fe1ebe9c8..4250aa5d0 100644--- a/api/test/test_backwards_compat.py+++ b/api/test/test_backwards_compat.py@@ -6,10 +6,11 @@ Run with the `pytest -s` command from this directory."""import uuid-from test.constants import API_URLimport requests+from test.constants import API_URL+def test_old_stats_endpoint():response = requests.get(diff --git a/api/test/test_dead_link_filter.py b/api/test/test_dead_link_filter.pyindex f767023b3..caa4600fb 100644--- a/api/test/test_dead_link_filter.py+++ b/api/test/test_dead_link_filter.py@@ -1,4 +1,3 @@-from test.constants import API_URLfrom unittest.mock import patchfrom uuid import uuid4@@ -8,6 +7,7 @@ import pytestimport requestsfrom api.controllers.elasticsearch.helpers import DEAD_LINK_RATIO+from test.constants import API_URL@pytest.fixturediff --git a/api/test/test_examples.py b/api/test/test_examples.pyindex 203b04d6c..e7ff9d648 100644--- a/api/test/test_examples.py+++ b/api/test/test_examples.py@@ -1,10 +1,11 @@import jsonimport osimport subprocess-from test.constants import API_URLimport pytest+from test.constants import API_URL+os.environ["AUDIO_REQ_TOKEN"] = ""os.environ["AUDIO_REQ_ORIGIN"] = API_URLdiff --git a/api/test/test_image_integration.py b/api/test/test_image_integration.pyindex 3e2df768b..f2709015c 100644--- a/api/test/test_image_integration.py+++ b/api/test/test_image_integration.py@@ -6,6 +6,11 @@ Run with the `pytest -s` command from this directory."""import json+from urllib.parse import urlencode++import pytest+import requests+from test.constants import API_URLfrom test.media_integration import (creator_collection,@@ -26,10 +31,6 @@ from test.media_integration import (tag_collection,uuid_validation,)-from urllib.parse import urlencode--import pytest-import requestsidentifier = "cdbd3bf6-1745-45bb-b399-61ee149cd58a"diff --git a/api/test/test_v1_integration.py b/api/test/test_v1_integration.pyindex 752584292..b29c57f4a 100644--- a/api/test/test_v1_integration.py+++ b/api/test/test_v1_integration.py@@ -6,7 +6,6 @@ Run with the `pytest -s` command from this directory."""import json-from test.constants import API_URLimport pytestimport requests@@ -14,6 +13,7 @@ import requestsfrom api.constants.licenses import LICENSE_GROUPSfrom api.models import Imagefrom api.utils.watermark import watermark+from test.constants import API_URL@pytest.fixturediff --git a/api/test/unit/conftest.py b/api/test/unit/conftest.pyindex 213dafd0c..ad70cd779 100644--- a/api/test/unit/conftest.py+++ b/api/test/unit/conftest.py@@ -1,10 +1,4 @@from dataclasses import dataclass-from test.factory import models as model_factories-from test.factory.models.media import (- CREATED_BY_FIXTURE_MARKER,- MediaFactory,- MediaReportFactory,-)from unittest.mock import MagicMockfrom rest_framework.test import APIClient, APIRequestFactory@@ -37,6 +31,12 @@ from api.serializers.media_serializers import (MediaSearchRequestSerializer,MediaSerializer,)+from test.factory import models as model_factories+from test.factory.models.media import (+ CREATED_BY_FIXTURE_MARKER,+ MediaFactory,+ MediaReportFactory,+)@pytest.fixturediff --git a/api/test/unit/controllers/elasticsearch/test_related.py b/api/test/unit/controllers/elasticsearch/test_related.pyindex 8da59714e..23370f3dd 100644--- a/api/test/unit/controllers/elasticsearch/test_related.py+++ b/api/test/unit/controllers/elasticsearch/test_related.py@@ -1,9 +1,3 @@-from test.factory.es_http import (- MOCK_LIVE_RESULT_URL_PREFIX,- create_mock_es_http_image_response_with_identifier,- create_mock_es_http_image_search_response,-)-from test.factory.models import ImageFactoryfrom unittest import mockimport pook@@ -14,6 +8,12 @@ from api.controllers.search_controller import (FILTERED_PROVIDERS_CACHE_KEY,FILTERED_PROVIDERS_CACHE_VERSION,)+from test.factory.es_http import (+ MOCK_LIVE_RESULT_URL_PREFIX,+ create_mock_es_http_image_response_with_identifier,+ create_mock_es_http_image_search_response,+)+from test.factory.models import ImageFactorypytestmark = pytest.mark.django_dbdiff --git a/api/test/unit/controllers/test_search_controller.py b/api/test/unit/controllers/test_search_controller.pyindex 652c43ea0..f64d3fa39 100644--- a/api/test/unit/controllers/test_search_controller.py+++ b/api/test/unit/controllers/test_search_controller.py@@ -4,12 +4,6 @@ import randomimport refrom collections.abc import Callablefrom enum import Enum, auto-from test.factory.es_http import (- MOCK_DEAD_RESULT_URL_PREFIX,- MOCK_LIVE_RESULT_URL_PREFIX,- create_mock_es_http_image_search_response,-)-from test.factory.models.content_provider import ContentProviderFactoryfrom unittest import mockfrom unittest.mock import patchfrom uuid import uuid4@@ -26,6 +20,12 @@ from api.controllers.search_controller import FILTERED_PROVIDERS_CACHE_KEYfrom api.utils import talliesfrom api.utils.dead_link_mask import get_query_hash, save_query_maskfrom api.utils.search_context import SearchContext+from test.factory.es_http import (+ MOCK_DEAD_RESULT_URL_PREFIX,+ MOCK_LIVE_RESULT_URL_PREFIX,+ create_mock_es_http_image_search_response,+)+from test.factory.models.content_provider import ContentProviderFactorypytestmark = pytest.mark.django_dbdiff --git a/api/test/unit/management/commands/test_generatewaveforms.py b/api/test/unit/management/commands/test_generatewaveforms.pyindex bc12a9669..c7ca58c6c 100644--- a/api/test/unit/management/commands/test_generatewaveforms.py+++ b/api/test/unit/management/commands/test_generatewaveforms.py@@ -1,7 +1,5 @@import subprocessfrom io import StringIO-from test.factory.faker import WaveformProvider-from test.factory.models.audio import AudioAddOnFactory, AudioFactoryfrom unittest import mockfrom django.core.management import call_command@@ -12,6 +10,8 @@ import pytestfrom psycopg.errors import NotNullViolationfrom api.models.audio import Audio, AudioAddOn+from test.factory.faker import WaveformProvider+from test.factory.models.audio import AudioAddOnFactory, AudioFactory@mock.patch("api.models.audio.generate_peaks")diff --git a/api/test/unit/models/test_audio.py b/api/test/unit/models/test_audio.pyindex 6a1b0e8c5..3372c6b0e 100644--- a/api/test/unit/models/test_audio.py+++ b/api/test/unit/models/test_audio.py@@ -1,10 +1,10 @@import uuid-from test.factory.faker import WaveformProviderfrom unittest import mockimport pytestfrom api.models.audio import Audio, AudioAddOn+from test.factory.faker import WaveformProvider@pytest.fixturediff --git a/api/test/unit/serializers/test_media_serializers.py b/api/test/unit/serializers/test_media_serializers.pyindex d48798c40..b6819e3c4 100644--- a/api/test/unit/serializers/test_media_serializers.py+++ b/api/test/unit/serializers/test_media_serializers.py@@ -1,6 +1,5 @@import randomimport uuid-from test.factory.models.oauth2 import AccessTokenFactoryfrom unittest.mock import MagicMock, patchfrom django.conf import settings@@ -14,6 +13,7 @@ from api.constants import sensitivityfrom api.serializers.audio_serializers import AudioSearchRequestSerializerfrom api.serializers.image_serializers import ImageSearchRequestSerializerfrom api.serializers.media_serializers import MediaSearchRequestSerializer+from test.factory.models.oauth2 import AccessTokenFactory@pytest.fixturediff --git a/api/test/unit/utils/test_image_proxy.py b/api/test/unit/utils/test_image_proxy.pyindex 5cf0e2833..cc0c98715 100644--- a/api/test/unit/utils/test_image_proxy.py+++ b/api/test/unit/utils/test_image_proxy.py@@ -1,7 +1,6 @@import asyncioimport itertoolsfrom dataclasses import replace-from test.factory.models.image import ImageFactoryfrom unittest.mock import patchfrom urllib.parse import urlencode@@ -23,6 +22,7 @@ from api.utils.image_proxy import ()from api.utils.image_proxy import get as _photon_getfrom api.utils.tallies import get_monthly_timestamp+from test.factory.models.image import ImageFactoryTEST_IMAGE_DOMAIN = "subdomain.example.com"diff --git a/api/test/unit/utils/test_throttle.py b/api/test/unit/utils/test_throttle.pyindex 531aecf44..1afdaff53 100644--- a/api/test/unit/utils/test_throttle.py+++ b/api/test/unit/utils/test_throttle.py@@ -1,6 +1,3 @@-from test.factory.models.image import ImageFactory-from test.factory.models.oauth2 import AccessTokenFactory-from django.http import HttpResponsefrom rest_framework.settings import api_settingsfrom rest_framework.test import force_authenticate@@ -10,6 +7,8 @@ import pytestfrom api.utils import throttlefrom api.views.media_views import MediaViewSet+from test.factory.models.image import ImageFactory+from test.factory.models.oauth2 import AccessTokenFactorycache_availability_params = pytest.mark.parametrize(diff --git a/api/test/unit/views/test_image_views.py b/api/test/unit/views/test_image_views.pyindex 235c56d44..0fe9aa82a 100644--- a/api/test/unit/views/test_image_views.py+++ b/api/test/unit/views/test_image_views.py@@ -1,6 +1,5 @@import jsonfrom pathlib import Path-from test.factory.models.image import ImageFactoryfrom unittest.mock import patchimport pook@@ -8,6 +7,7 @@ import pytestfrom PIL import UnidentifiedImageErrorfrom api.views.image_views import ImageViewSet+from test.factory.models.image import ImageFactory_MOCK_IMAGE_PATH = Path(__file__).parent / ".." / ".." / "factory"diff --git a/automations/python/models/label.py b/automations/python/models/label.pyindex 0340cd97e..edbed65a4 100644--- a/automations/python/models/label.py+++ b/automations/python/models/label.py@@ -1,6 +1,7 @@-from models.label_group import LabelGroupfrom shared.data import get_data+from models.label_group import LabelGroup+class Label:diff --git a/automations/python/shared/labels.py b/automations/python/shared/labels.pyindex 07dd41236..04532e123 100644--- a/automations/python/shared/labels.py+++ b/automations/python/shared/labels.py@@ -2,6 +2,7 @@ from copy import deepcopyfrom models.label import Labelfrom models.label_group import LabelGroup+from shared.data import get_datadiff --git a/catalog/dags/database/delete_records/delete_records.py b/catalog/dags/database/delete_records/delete_records.pyindex 8cdc383f9..ba08db725 100644--- a/catalog/dags/database/delete_records/delete_records.py+++ b/catalog/dags/database/delete_records/delete_records.py@@ -7,7 +7,7 @@ from airflow.models.abstractoperator import AbstractOperatorfrom common import slackfrom common.constants import POSTGRES_CONN_IDfrom common.sql import RETURN_ROW_COUNT, PostgresHook-from common.storage.columns import DELETED_ON, Column, PROVIDER, FOREIGN_ID+from common.storage.columns import DELETED_ON, FOREIGN_ID, PROVIDER, Columnfrom common.storage.db_columns import (setup_db_columns_for_media_type,setup_deleted_db_columns_for_media_type,diff --git a/catalog/dags/elasticsearch_cluster/create_new_es_index/create_new_es_index_dag.py b/catalog/dags/elasticsearch_cluster/create_new_es_index/create_new_es_index_dag.pyindex 39f23f0d9..ad4c3229c 100644--- a/catalog/dags/elasticsearch_cluster/create_new_es_index/create_new_es_index_dag.py+++ b/catalog/dags/elasticsearch_cluster/create_new_es_index/create_new_es_index_dag.py@@ -110,6 +110,7 @@ from elasticsearch_cluster.create_new_es_index.create_new_es_index_types importCreateNewIndex,)+logger = logging.getLogger(__name__)diff --git a/catalog/dags/popularity/popularity_refresh_dag_factory.py b/catalog/dags/popularity/popularity_refresh_dag_factory.pyindex ae7a11720..d8f05b433 100644--- a/catalog/dags/popularity/popularity_refresh_dag_factory.py+++ b/catalog/dags/popularity/popularity_refresh_dag_factory.py@@ -28,16 +28,16 @@ from datetime import datetimefrom airflow import DAGfrom airflow.decorators import taskfrom airflow.operators.trigger_dagrun import TriggerDagRunOperator++from common import slack+from common.constants import DAG_DEFAULT_ARGS, POSTGRES_CONN_ID+from database.batched_update.constants import DAG_ID as BATCHED_UPDATE_DAG_IDfrom popularity import sqlfrom popularity.popularity_refresh_types import (POPULARITY_REFRESH_CONFIGS,PopularityRefresh,)-from common import slack-from common.constants import DAG_DEFAULT_ARGS, POSTGRES_CONN_ID-from database.batched_update.constants import DAG_ID as BATCHED_UPDATE_DAG_ID-logger = logging.getLogger(__name__)diff --git a/catalog/dags/popularity/recreate_popularity_calculation_dag_factory.py b/catalog/dags/popularity/recreate_popularity_calculation_dag_factory.pyindex 31261ec38..f8662b06b 100644--- a/catalog/dags/popularity/recreate_popularity_calculation_dag_factory.py+++ b/catalog/dags/popularity/recreate_popularity_calculation_dag_factory.py@@ -13,14 +13,14 @@ These DAGs are not on a schedule, and should only be run manually when newSQL code is deployed for the calculation."""from airflow import DAG++from common.constants import DAG_DEFAULT_ARGS, POSTGRES_CONN_IDfrom popularity import sqlfrom popularity.popularity_refresh_types import (POPULARITY_REFRESH_CONFIGS,PopularityRefresh,)-from common.constants import DAG_DEFAULT_ARGS, POSTGRES_CONN_ID-def create_recreate_popularity_calculation_dag(popularity_refresh: PopularityRefresh):media_type = popularity_refresh.media_typediff --git a/catalog/dags/popularity/sql.py b/catalog/dags/popularity/sql.pyindex bacf3bf62..388bd02f9 100644--- a/catalog/dags/popularity/sql.py+++ b/catalog/dags/popularity/sql.py@@ -4,12 +4,12 @@ from textwrap import dedentfrom airflow.decorators import task, task_groupfrom airflow.models.abstractoperator import AbstractOperator-from popularity.popularity_refresh_types import PopularityRefreshfrom common.constants import DAG_DEFAULT_ARGS, SQLInfofrom common.sql import PostgresHook, single_valuefrom common.storage import columns as colfrom common.utils import setup_sql_info_for_media_type+from popularity.popularity_refresh_types import PopularityRefreshDEFAULT_PERCENTILE = 0.85diff --git a/catalog/dags/providers/provider_dag_factory.py b/catalog/dags/providers/provider_dag_factory.pyindex 65f94b807..1e5a5d040 100644--- a/catalog/dags/providers/provider_dag_factory.py+++ b/catalog/dags/providers/provider_dag_factory.py@@ -76,9 +76,8 @@ from airflow.operators.python import PythonOperatorfrom airflow.utils.task_group import TaskGroupfrom airflow.utils.trigger_rule import TriggerRule-from common.constants import AWS_CONN_ID, DAG_DEFAULT_ARGS+from common.constants import AWS_CONN_ID, DAG_DEFAULT_ARGS, XCOM_PULL_TEMPLATEfrom common.constants import POSTGRES_CONN_ID as DB_CONN_ID-from common.constants import XCOM_PULL_TEMPLATEfrom common.loader import loader, reporting, s3, sqlfrom providers.factory_utils import date_partition_for_prefix, pull_media_wrapperfrom providers.provider_reingestion_workflows import ProviderReingestionWorkflowdiff --git a/ingestion_server/ingestion_server/api.py b/ingestion_server/ingestion_server/api.pyindex dc004a867..7285fc695 100644--- a/ingestion_server/ingestion_server/api.py+++ b/ingestion_server/ingestion_server/api.py@@ -1,10 +1,9 @@"""A small RPC API server for scheduling data refresh and indexing tasks."""-from collections import defaultdict-import loggingimport osimport timeimport uuid+from collections import defaultdictfrom multiprocessing import Process, Valuefrom pathlib import Pathfrom urllib.parse import urlparse@@ -17,8 +16,8 @@ from sentry_sdk.integrations.falcon import FalconIntegrationfrom ingestion_server import slackfrom ingestion_server.constants.media_types import MEDIA_TYPES, MediaTypefrom ingestion_server.db_helpers import (- DB_UPSTREAM_CONFIG,DB_API_CONFIG,+ DB_UPSTREAM_CONFIG,database_connect,)from ingestion_server.es_helpers import elasticsearch_connect, get_statdiff --git a/ingestion_server/ingestion_server/cleanup.py b/ingestion_server/ingestion_server/cleanup.pyindex e7a5dfa30..23f69f843 100644--- a/ingestion_server/ingestion_server/cleanup.py+++ b/ingestion_server/ingestion_server/cleanup.py@@ -14,8 +14,9 @@ import requests as reimport tldextractfrom psycopg2.extras import DictCursor, Json-from ingestion_server.indexer import DB_BUFFER_SIZEfrom ingestion_server.db_helpers import database_connect+from ingestion_server.indexer import DB_BUFFER_SIZE+# Number of records to buffer in memory at onceCLEANUP_BUFFER_SIZE = DB_BUFFER_SIZEdiff --git a/ingestion_server/ingestion_server/ingest.py b/ingestion_server/ingestion_server/ingest.pyindex f400f10ff..dacd7395d 100644--- a/ingestion_server/ingestion_server/ingest.py+++ b/ingestion_server/ingestion_server/ingest.py@@ -26,7 +26,7 @@ from psycopg2.sql import SQL, Identifier, Literalfrom ingestion_server import slackfrom ingestion_server.cleanup import clean_image_datafrom ingestion_server.constants.internal_types import ApproachType-from ingestion_server.db_helpers import database_connect, DB_UPSTREAM_CONFIG+from ingestion_server.db_helpers import DB_UPSTREAM_CONFIG, database_connectfrom ingestion_server.queries import (get_copy_data_query,get_create_ext_query,diff --git a/ingestion_server/test/unit_tests/test_cleanup.py b/ingestion_server/test/unit_tests/test_cleanup.pyindex 8e6daa2c7..e8b8dcc10 100644--- a/ingestion_server/test/unit_tests/test_cleanup.py+++ b/ingestion_server/test/unit_tests/test_cleanup.py@@ -1,9 +1,9 @@-from test.unit_tests.conftest import create_mock_imagefrom unittest.mock import MagicMockfrom psycopg2._json import Jsonfrom ingestion_server.cleanup import CleanupFunctions, TlsTest+from test.unit_tests.conftest import create_mock_imageclass TestCleanup:diff --git a/ingestion_server/test/unit_tests/test_es_image_model.py b/ingestion_server/test/unit_tests/test_es_image_model.pyindex ad79c950c..940261a85 100644--- a/ingestion_server/test/unit_tests/test_es_image_model.py+++ b/ingestion_server/test/unit_tests/test_es_image_model.py@@ -1,6 +1,5 @@-from test.unit_tests.conftest import create_mock_image-from ingestion_server.elasticsearch_models import Image+from test.unit_tests.conftest import create_mock_imageclass TestImage:diff --git a/pyproject.toml b/pyproject.tomlindex 3263fb57a..cc0d05806 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -10,8 +10,9 @@ ignore-words = ".codespell/ignore_words.txt"# Default for `select` is ["E4", "E7", "E9", "F"]# All additional rules must be added using `extend-select`.extend-select = [- "UP",+ "UP", # pyupgrade, https://docs.astral.sh/ruff/rules/#pyupgrade-up"D", # pydocstyle, https://docs.astral.sh/ruff/rules/#pydocstyle-d+ "I", # isort, https://docs.astral.sh/ruff/rules/#isort-i]ignore = ["D1", # D1xx: we do not want to force contributors to write redundant or useless docstrings@@ -45,10 +46,12 @@ known-first-party = ["common","data_refresh","database",+ "elasticsearch_cluster","maintenance","oauth2","providers","retired",+ "test",][tool.ruff.lint.isort.sections]