Skip to content

Commit

Permalink
Release 1.4.1 (#1997)
Browse files Browse the repository at this point in the history
* Update LS version

* Update DM

* Update converter and version

* fix: DEV-1683: Relax dependencies or allow botocore==1.19.52

* Update version to 1.4.1rc2

* Change version to 1.4.1

* fix: parsed_label_config bug (#2018)

* fix: parsed_label_config cache bug

* Update version

* Update version again

* Update __init__.py

* Move save after parsed config

* Fix tests

* Add migration

* Speed up tests with xdist

* Update pytest libs

* Another try for speed up

* Update pytest-cov

* Try another pytest-cov version

* Prebuild without frontend for pytests

* Skip cov tests on windows

* Another win tests try :-)

* Pytest with python3

* Move pip to python -m

* Add pytest install into test section

* Fix deps for tests
  • Loading branch information
makseq committed Feb 12, 2022
1 parent 656a0ea commit a26ba3e
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 40 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
${{ runner.os }}-node-${{ env.NODE }}-
- name: Install LSF & set version.py
run: ./deploy/prebuild.sh
run: ./deploy/prebuild_wo_frontend.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -89,7 +89,7 @@ jobs:
- name: Run functional tests
run: |
cd label_studio/
pytest --junitxml report.xml --cov=. -vv
pytest --junitxml report.xml --cov=. -vv -n auto
run_pytest_postgresql:
name: LS PostgreSQL Ubuntu
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:
${{ runner.os }}-node-${{ env.NODE }}-
- name: Install LSF & set version.py
run: ./deploy/prebuild.sh
run: ./deploy/prebuild_wo_frontend.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -201,7 +201,7 @@ jobs:
- name: Run functional tests
run: |
cd label_studio/
pytest --junitxml report.xml --cov=. -vv
pytest --junitxml report.xml --cov=. -vv -n auto
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2.1.0
Expand Down Expand Up @@ -275,12 +275,14 @@ jobs:
collect_analytics: 0
run: |
cd label_studio/
coverage run -m pytest
python -m pytest -vv -n auto
# coverage run -m pytest -n auto

- name: Collect coverage results
if: always()
env:
collect_analytics: 0
run: |
cd label_studio/
coverage report -i -m --fail-under=40

# - name: Collect coverage results
# if: always()
# env:
# collect_analytics: 0
# run: |
# cd label_studio/
# coverage report -i -m --fail-under=40
7 changes: 4 additions & 3 deletions deploy/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
pytest==6.2.2
pytest-cov==2.9.0
pytest==6.2.5
pytest-cov==2.12.1
pytest-django==4.1.0
pytest-mock==1.10.3
requests-mock==1.5.2
pyyaml>=5.3.1
moto==1.3.16.dev122
tavern==1.14.0
tavern==1.19.0
fakeredis==1.5.0
pytest-env==0.6.2
responses==0.13.0
pytest-xdist~=2.5.0
13 changes: 7 additions & 6 deletions deploy/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ attr==0.3.1
attrs>=19.2.0
pyyaml>=5.3.1
azure-storage-blob>=12.6.0
boto==2.49.0
boto3==1.16.28
botocore==1.19.28

boto~=2.49.0
boto3~=1.16.28
botocore~=1.19.28

google-api-core==1.31.5
google-auth==1.35.0
google-cloud-appengine-logging==1.1.0
google-cloud-audit-log==0.2.0
google-cloud-core==1.5.0
google-cloud-logging==2.7.0
google-cloud-storage==1.29.0
google-cloud-storage~=1.29.0
google-cloud-logging~=2.7.0
google-resumable-media==0.5.1
googleapis-common-protos==1.52.0
grpc-google-iam-v1==0.12.3
Expand Down Expand Up @@ -57,5 +58,5 @@ redis>=3.5.0
sentry-sdk>=1.1.0
launchdarkly-server-sdk==7.3.0

label-studio-converter==0.0.38
label-studio-converter==0.0.39
label-studio-tools==0.0.0.dev11
2 changes: 1 addition & 1 deletion label_studio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package_name = 'label-studio'

# Package version
__version__ = '1.4'
__version__ = '1.4.1post1'

# pypi info
__latest_version__ = None
Expand Down
1 change: 0 additions & 1 deletion label_studio/core/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
from collections import defaultdict

from base64 import b64encode
from lockfile import LockFile
from datetime import datetime
from appdirs import user_cache_dir
from functools import wraps
Expand Down
27 changes: 27 additions & 0 deletions label_studio/projects/migrations/0016_auto_20220211_2218.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 3.1.14 on 2022-02-11 22:18

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('projects', '0015_merge_20220117_0749'),
]

operations = [
migrations.AlterField(
model_name='project',
name='min_annotations_to_start_training',
field=models.IntegerField(default=0, help_text='Minimum number of completed tasks after which model training is started', verbose_name='min_annotations_to_start_training'),
),
migrations.RemoveField(
model_name='project',
name='parsed_label_config',
),
migrations.AddField(
model_name='project',
name='parsed_label_config',
field=models.JSONField(blank=True, default=None, help_text='Parsed label config in JSON format. See more about it in documentation', null=True, verbose_name='parsed label config'),
),
]
15 changes: 9 additions & 6 deletions label_studio/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ class SkipQueue(models.TextChoices):
default='<View></View>',
help_text='Label config in XML format. See more about it in documentation',
)
parsed_label_config = models.TextField(
parsed_label_config = models.JSONField(
_('parsed label config'),
blank=True,
null=True,
default='',
default=None,
help_text='Parsed label config in JSON format. See more about it in documentation',
)
expert_instruction = models.TextField(
Expand Down Expand Up @@ -550,18 +550,20 @@ def get_updated_weights(self):

def save(self, *args, recalc=True, **kwargs):
exists = True if self.pk else False
project_with_config_just_created = not exists and self.label_config

if self.label_config and (self._label_config_has_changed() or not exists or not self.control_weights):
self.control_weights = self.get_updated_weights()
super(Project, self).save(*args, **kwargs)
project_with_config_just_created = not exists and self.pk and self.label_config
if self._label_config_has_changed() or project_with_config_just_created:
self.data_types = extract_data_types(self.label_config)
self.parsed_label_config = parse_config(self.label_config)

if self.label_config and (self._label_config_has_changed() or not exists or not self.control_weights):
self.control_weights = self.get_updated_weights()

if self._label_config_has_changed():
self.__original_label_config = self.label_config

super(Project, self).save(*args, **kwargs)

if not exists:
steps = ProjectOnboardingSteps.objects.all()
objs = [ProjectOnboarding(project=self, step=step) for step in steps]
Expand Down Expand Up @@ -710,6 +712,7 @@ def get_control_tags_from_config(self):
def get_parsed_config(self):
if self.parsed_label_config:
return self.parsed_label_config

return parse_config(self.label_config)

def get_counters(self):
Expand Down
11 changes: 0 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@
import label_studio
import sys

# python 3.9 warning
if sys.version_info[0] == 3 and sys.version_info[1] >= 9:
print()
print('~========================================================~')
print('| Your python version is %i.%i and Label Studio has a |' % (sys.version_info[0], sys.version_info[1]))
print('| lot of installation problems with this Python version. |')
print('| Please use Python 3.6 - 3.8 to avoid problems with |')
print('| your installation. |')
print('~========================================================~')
print()

print(label_studio.package_name, label_studio.__version__)

# Readme
Expand Down

0 comments on commit a26ba3e

Please sign in to comment.