Skip to content

Commit

Permalink
Remove six from dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Jul 7, 2024
1 parent d692382 commit 08ee48c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
4 changes: 1 addition & 3 deletions django_fakery/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from django.apps import apps
from django.db import models

from six import string_types

from .types import T


Expand All @@ -29,7 +27,7 @@ def get_model(model: T) -> T:


def get_model(model):
if isinstance(model, string_types):
if isinstance(model, str):
model = apps.get_model(*model.split("."))
return model

Expand Down
4 changes: 1 addition & 3 deletions django_fakery/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

from django.db import models

from six import string_types

from . import field_mappings


Expand Down Expand Up @@ -33,7 +31,7 @@ def evaluate(self, value):
return value(self.iteration, self.faker)
else:
return value()
if isinstance(value, string_types):
if isinstance(value, str):
try:
return value.format(self.iteration, self.faker)
except KeyError:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"Programming Language :: Python :: 3.11",
],
entry_points={"pytest11": ["django_fakery = django_fakery.plugin"]},
install_requires=["Faker>=10.0,<11.0", "Django>=3.2", "six>=1.10.1"],
install_requires=["Faker>=10.0,<11.0", "Django>=3.2"],
python_requires=">=3.8",
test_suite="tests.runtests.runtests",
)
4 changes: 1 addition & 3 deletions tests/test_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

from django.test import TestCase

from six import text_type

from django_fakery import factory
from django_fakery.compat import HAS_PSYCOPG2

Expand All @@ -23,7 +21,7 @@ def test_postgres_fields(self):
gigis_special = factory.make("tests.SpecialtyPizza")
self.assertTrue(isinstance(gigis_special.toppings, list))
for topping in gigis_special.toppings:
self.assertTrue(isinstance(topping, text_type))
self.assertTrue(isinstance(topping, str))

self.assertTrue(isinstance(gigis_special.metadata, dict))
self.assertTrue(isinstance(gigis_special.price_range, NumericRange))
Expand Down

0 comments on commit 08ee48c

Please sign in to comment.