diff --git a/.isort.cfg b/.isort.cfg index 0b2486fd1d40152385f555d4db2c30ecd292ca23..27b313cba6fee655b44650d0dd71adf123123ca3 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -8,4 +8,4 @@ line_length = 120 default_section=FIRSTPARTY known_first_party = arkindex_common,ponos,transkribus -known_third_party = boto3,botocore,corsheaders,django,django_admin_hstore_widget,django_rq,elasticsearch,elasticsearch_dsl,enumfields,gitlab,psycopg2,requests,responses,rest_framework,rq,setuptools,sqlparse,tenacity,tripoli,yaml +known_third_party = boto3,botocore,corsheaders,django,django_admin_hstore_widget,django_rq,elasticsearch,elasticsearch_dsl,enumfields,gitlab,psycopg2,requests,responses,rest_framework,rq,setuptools,sqlparse,teklia_toolbox,tenacity,tripoli,yaml diff --git a/arkindex/documents/management/commands/delete.py b/arkindex/documents/management/commands/delete.py index f57cfa34d043ba81ac34256cf101febe87472914..c1574f6eb530cb980fd99515f68ebb29ed9bc158 100644 --- a/arkindex/documents/management/commands/delete.py +++ b/arkindex/documents/management/commands/delete.py @@ -3,9 +3,9 @@ import logging import uuid from django.core.management.base import BaseCommand +from teklia_toolbox.time import Timer from arkindex.documents.models import Element -from arkindex_common.tools import Timer # Enable deletion signal logs logging.basicConfig( diff --git a/arkindex/images/management/commands/deduplicate_zones.py b/arkindex/images/management/commands/deduplicate_zones.py index b260534834f56ae7627e452df07cd9b06e11f1a1..01394cb5fbb3eea6754a4c137f78acd06ec542ec 100644 --- a/arkindex/images/management/commands/deduplicate_zones.py +++ b/arkindex/images/management/commands/deduplicate_zones.py @@ -1,7 +1,6 @@ from django.core.management.base import BaseCommand from django.db import connections, transaction - -from arkindex_common.tools import Timer +from teklia_toolbox.time import Timer class Command(BaseCommand): diff --git a/arkindex/project/config.py b/arkindex/project/config.py index c88c936c41d26096a6157402a9ecf91548fff184..e79d6d93a88b6ab7ad39611744719813e5680064 100644 --- a/arkindex/project/config.py +++ b/arkindex/project/config.py @@ -2,7 +2,7 @@ import uuid from enum import Enum from pathlib import Path -from arkindex_common.config_parser import ConfigParser, ConfigurationError, dir_path +from teklia_toolbox.config import ConfigParser, ConfigurationError, dir_path class CacheType(Enum): diff --git a/arkindex/project/tests/test_config.py b/arkindex/project/tests/test_config.py index cf5030d106d96e32314faac80029befb9593c491..ffa28639676f974a629a1cfd6749d5fa1770af8c 100644 --- a/arkindex/project/tests/test_config.py +++ b/arkindex/project/tests/test_config.py @@ -5,9 +5,9 @@ from unittest import TestCase from unittest.mock import patch import yaml +from teklia_toolbox.config import ConfigParser, ConfigurationError from arkindex.project.config import get_settings_parser -from arkindex_common.config_parser import ConfigParser, ConfigurationError SAMPLES = Path(__file__).resolve().parent / 'config_samples' @@ -42,8 +42,7 @@ class TestConfig(TestCase): return stream.getvalue() # Ignore non-existent paths - @patch('arkindex_common.config_parser.dir_path', new=Path) - @patch('arkindex_common.config_parser.file_path', new=Path) + @patch('teklia_toolbox.config.dir_path', new=Path) def test_settings_defaults(self): parser = get_settings_parser(Path('/somewhere/backend/arkindex')) self.assertIsInstance(parser, ConfigParser) @@ -57,8 +56,7 @@ class TestConfig(TestCase): self.maxDiff = None self.assertEqual(expected, actual) - @patch('arkindex_common.config_parser.dir_path', new=Path) - @patch('arkindex_common.config_parser.file_path', new=Path) + @patch('teklia_toolbox.config.dir_path', new=Path) def test_settings_override(self): parser = get_settings_parser(Path('/somewhere/backend/arkindex')) self.assertIsInstance(parser, ConfigParser) @@ -72,7 +70,7 @@ class TestConfig(TestCase): self.maxDiff = None self.assertEqual(expected, actual) - @patch('arkindex_common.config_parser._all_checks') + @patch('teklia_toolbox.config._all_checks') def test_settings_errors(self, all_checks_mock): all_checks_mock.return_value = True parser = get_settings_parser(Path('/somewhere/backend/arkindex')) diff --git a/requirements.txt b/requirements.txt index 775d874bd9e5e80335435f58c5855002f42e4175..24cc9afb2c8563cf3e265705a523c47377dab464 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,6 +18,7 @@ pytz==2020.4 PyYAML==5.3.1 requests==2.25.0 sentry-sdk==0.19.2 +teklia-toolbox==0.1.0 tenacity==6.2 transkribus-client>=0.1.1 git+https://gitlab.com/arkindex/transkribus.git#egg=transkribus-client