From 89e6789541ae9a0ea742e6f5726c3f998878b160 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 29 Jun 2024 03:20:34 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- django_ltree/__init__.py | 2 +- django_ltree/paths.py | 3 --- tests/conftest.py | 2 +- tests/taxonomy/apps.py | 2 +- tests/taxonomy/migrations/0001_initial.py | 24 ++++++++++++++--------- tests/test_path_value.py | 2 -- 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/django_ltree/__init__.py b/django_ltree/__init__.py index 2a28f90..e3b0191 100644 --- a/django_ltree/__init__.py +++ b/django_ltree/__init__.py @@ -1 +1 @@ -default_app_config = 'django_ltree.apps.DjangoLtreeConfig' +default_app_config = "django_ltree.apps.DjangoLtreeConfig" diff --git a/django_ltree/paths.py b/django_ltree/paths.py index 0372b4f..d53e6c4 100644 --- a/django_ltree/paths.py +++ b/django_ltree/paths.py @@ -28,7 +28,6 @@ def __next__(self): if path not in self.skip_paths: return path - @staticmethod def guess_the_label_size(path_size: int, combination_size: int) -> int: # The theoritical limit for this at the time of writing is 2_538_557_185_841_324_496 (python 3.12.2) @@ -53,5 +52,3 @@ def guess_the_label_size(path_size: int, combination_size: int) -> int: label_size += 1 return label_size - - diff --git a/tests/conftest.py b/tests/conftest.py index af05ff6..2d9a97b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -13,7 +13,7 @@ def pytest_sessionstart(session): "NAME": "ltree_test", "HOST": os.environ.get("DJANGO_DATABASE_HOST", "database"), "USER": os.environ.get("DJANGO_DATABASE_USER", "postgres"), - "PASSWORD": os.environ.get("DJANGO_DATABASE_PASSWORD", "") + "PASSWORD": os.environ.get("DJANGO_DATABASE_PASSWORD", ""), } }, ROOT_URLCONF="tests.urls", diff --git a/tests/taxonomy/apps.py b/tests/taxonomy/apps.py index cdbd4f0..ecb836e 100644 --- a/tests/taxonomy/apps.py +++ b/tests/taxonomy/apps.py @@ -2,4 +2,4 @@ class TaxonomyConfig(AppConfig): - name = 'taxonomy' + name = "taxonomy" diff --git a/tests/taxonomy/migrations/0001_initial.py b/tests/taxonomy/migrations/0001_initial.py index 165cc6c..2267f9c 100644 --- a/tests/taxonomy/migrations/0001_initial.py +++ b/tests/taxonomy/migrations/0001_initial.py @@ -7,23 +7,29 @@ class Migration(migrations.Migration): - initial = True - dependencies = [ - ] + dependencies = [] operations = [ migrations.CreateModel( - name='Taxonomy', + name="Taxonomy", fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('path', django_ltree.fields.PathField(unique=True)), - ('name', models.TextField()), + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("path", django_ltree.fields.PathField(unique=True)), + ("name", models.TextField()), ], options={ - 'ordering': ('path',), - 'abstract': False, + "ordering": ("path",), + "abstract": False, }, ), ] diff --git a/tests/test_path_value.py b/tests/test_path_value.py index acc4543..ca0a5ee 100644 --- a/tests/test_path_value.py +++ b/tests/test_path_value.py @@ -1,5 +1,3 @@ -import pytest - from django_ltree.fields import PathValue