Browse Source

Merge pull request #1520 from doccano/fix/CI

Fix CI problem
pull/1521/head
Hiroki Nakayama 3 years ago
committed by GitHub
parent
commit
0489118f92
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 9 deletions
  1. 2
      Dockerfile
  2. 2
      backend/Dockerfile.dev
  3. 2
      backend/Dockerfile.prod
  4. 2
      backend/api/models.py
  5. 4
      backend/api/tasks.py
  6. 8
      backend/api/views/label.py

2
Dockerfile

@ -1,4 +1,4 @@
ARG PYTHON_VERSION="3.9.6-slim-buster"
ARG PYTHON_VERSION="3.8.12-slim-buster"
ARG NODE_VERSION="16.5-alpine3.14"
FROM node:${NODE_VERSION} AS frontend-builder

2
backend/Dockerfile.dev

@ -1,4 +1,4 @@
ARG PYTHON_VERSION="3.9.6-slim-buster"
ARG PYTHON_VERSION="3.8.12-slim-buster"
FROM python:${PYTHON_VERSION}
RUN apt-get update \

2
backend/Dockerfile.prod

@ -1,4 +1,4 @@
ARG PYTHON_VERSION="3.9.6-slim-buster"
ARG PYTHON_VERSION="3.8.12-slim-buster"
FROM python:${PYTHON_VERSION}
CMD ["python3"]

2
backend/api/models.py

@ -1,8 +1,6 @@
import string
from typing import Literal
from django import db
from auto_labeling_pipeline.models import RequestModelFactory
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError

4
backend/api/tasks.py

@ -1,6 +1,6 @@
import itertools
from celery import shared_task
from celery import shared_task
from celery.utils.log import get_task_logger
from django.conf import settings
from django.contrib.auth import get_user_model
@ -15,6 +15,8 @@ from .views.upload.factory import (get_data_class, get_dataset_class,
from .views.upload.utils import append_field
logger = get_task_logger(__name__)
class Buffer:
def __init__(self, buffer_size=settings.IMPORT_BATCH_SIZE):

8
backend/api/views/label.py

@ -15,12 +15,14 @@ from ..models import Label, Project
from ..permissions import IsInProjectReadOnlyOrAdmin, IsProjectAdmin
from ..serializers import LabelSerializer
def camel_to_snake(name):
name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', name).lower()
name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', name).lower()
def camel_to_snake_dict(d):
return {camel_to_snake(k): v for k,v in d.items()}
return {camel_to_snake(k): v for k, v in d.items()}
class LabelList(generics.ListCreateAPIView):

Loading…
Cancel
Save