Browse Source
Merge pull request #2132 from doccano/enhancement/packages
[Enhancement] Update dependencies
pull/2134/head
Hiroki Nakayama
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
166 additions and
913 deletions
-
backend/examples/tests/test_models.py
-
backend/examples/views/example.py
-
backend/label_types/tests/utils.py
-
backend/labels/tests/test_span.py
-
backend/poetry.lock
-
backend/pyproject.toml
|
|
@ -55,7 +55,8 @@ class TestExampleState(TestCase): |
|
|
|
expected_progress = [{"user": member.username, "done": 0} for member in self.project.members] |
|
|
|
expected_progress[0]["done"] = 1 |
|
|
|
expected_progress[1]["done"] = 1 |
|
|
|
self.assertEqual(progress, {"total": 2, "progress": expected_progress}) |
|
|
|
self.assertEqual(progress["total"], 2) |
|
|
|
self.assertCountEqual(progress["progress"], expected_progress) |
|
|
|
|
|
|
|
|
|
|
|
class TestExample(TestCase): |
|
|
|
|
|
@ -21,7 +21,7 @@ class ExampleList(generics.ListCreateAPIView): |
|
|
|
ordering_fields = ("created_at", "updated_at", "score") |
|
|
|
search_fields = ("text", "filename") |
|
|
|
model = Example |
|
|
|
filter_class = ExampleFilter |
|
|
|
filterset_class = ExampleFilter |
|
|
|
|
|
|
|
@property |
|
|
|
def project(self): |
|
|
|
|
|
@ -1,10 +1,10 @@ |
|
|
|
from model_mommy import mommy |
|
|
|
|
|
|
|
from projects.models import BOUNDING_BOX |
|
|
|
from projects.models import BOUNDING_BOX, SEGMENTATION |
|
|
|
|
|
|
|
|
|
|
|
def make_label(project, **kwargs): |
|
|
|
if project.project_type.endswith("Classification") or project.project_type == BOUNDING_BOX: |
|
|
|
if project.project_type.endswith("Classification") or project.project_type in {BOUNDING_BOX, SEGMENTATION}: |
|
|
|
return mommy.make("CategoryType", project=project, **kwargs) |
|
|
|
else: |
|
|
|
return mommy.make("SpanType", project=project, **kwargs) |
|
|
@ -1,7 +1,6 @@ |
|
|
|
import abc |
|
|
|
|
|
|
|
from django.core.exceptions import ValidationError |
|
|
|
from django.db import IntegrityError |
|
|
|
from django.test import TestCase |
|
|
|
from model_mommy import mommy |
|
|
|
|
|
|
@ -142,15 +141,15 @@ class TestSpan(TestCase): |
|
|
|
self.user = self.project.admin |
|
|
|
|
|
|
|
def test_start_offset_is_not_negative(self): |
|
|
|
with self.assertRaises(IntegrityError): |
|
|
|
with self.assertRaises(ValidationError): |
|
|
|
mommy.make("Span", start_offset=-1, end_offset=0) |
|
|
|
|
|
|
|
def test_end_offset_is_not_negative(self): |
|
|
|
with self.assertRaises(IntegrityError): |
|
|
|
with self.assertRaises(ValidationError): |
|
|
|
mommy.make("Span", start_offset=-2, end_offset=-1) |
|
|
|
|
|
|
|
def test_start_offset_is_less_than_end_offset(self): |
|
|
|
with self.assertRaises(IntegrityError): |
|
|
|
with self.assertRaises(ValidationError): |
|
|
|
mommy.make("Span", start_offset=0, end_offset=0) |
|
|
|
|
|
|
|
def test_unique_constraint(self): |
|
|
|
|
|
@ -35,14 +35,14 @@ doccano = 'backend.cli:main' |
|
|
|
|
|
|
|
[tool.poetry.dependencies] |
|
|
|
python = "^3.8" |
|
|
|
Django = "^4.0.2" |
|
|
|
Django = "^4.1.7" |
|
|
|
environs = "^9.5.0" |
|
|
|
furl = "^2.1.3" |
|
|
|
djangorestframework = "^3.13.1" |
|
|
|
django-filter = "^21.1" |
|
|
|
djangorestframework = "^3.14.0" |
|
|
|
django-filter = "^22.1" |
|
|
|
django-polymorphic = "^3.1.0" |
|
|
|
django-cors-headers = "^3.11.0" |
|
|
|
drf-yasg = "^1.20.0" |
|
|
|
django-cors-headers = "^3.13.0" |
|
|
|
drf-yasg = "^1.21.5" |
|
|
|
django-rest-polymorphic = "^0.1.9" |
|
|
|
chardet = "^4.0.0" |
|
|
|
pyexcel = "^0.7.0" |
|
|
@ -53,7 +53,7 @@ pyexcel-xlsx = "^0.6.0" |
|
|
|
gunicorn = "^20.1.0" |
|
|
|
auto-labeling-pipeline = "^0.1.21" |
|
|
|
dj-rest-auth = {extras = ["with_social"], version = "^2.2.5"} |
|
|
|
django-drf-filepond = "^0.4.1" |
|
|
|
django-drf-filepond = "^0.5.0" |
|
|
|
celery = "^5.2.3" |
|
|
|
django-celery-results = "2.4.0" |
|
|
|
SQLAlchemy = "^1.4.31" |
|
|
@ -65,7 +65,7 @@ django-cleanup = "^6.0.0" |
|
|
|
filetype = "^1.0.10" |
|
|
|
pandas = "^1.4.2" |
|
|
|
flower = "^1.2.0" |
|
|
|
django-allauth = "0.50.0" |
|
|
|
django-allauth = "^0.52.0" |
|
|
|
|
|
|
|
[tool.poetry.dev-dependencies] |
|
|
|
model-mommy = "^2.0.0" |
|
|
|