Skip to content

Commit a26ba3e

Browse files
authored
Release 1.4.1 (#1997)
* 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
1 parent 656a0ea commit a26ba3e

File tree

8 files changed

+62
-40
lines changed

8 files changed

+62
-40
lines changed

.github/workflows/tests.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
${{ runner.os }}-node-${{ env.NODE }}-
8080
8181
- name: Install LSF & set version.py
82-
run: ./deploy/prebuild.sh
82+
run: ./deploy/prebuild_wo_frontend.sh
8383
env:
8484
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8585

@@ -89,7 +89,7 @@ jobs:
8989
- name: Run functional tests
9090
run: |
9191
cd label_studio/
92-
pytest --junitxml report.xml --cov=. -vv
92+
pytest --junitxml report.xml --cov=. -vv -n auto
9393
9494
run_pytest_postgresql:
9595
name: LS PostgreSQL Ubuntu
@@ -191,7 +191,7 @@ jobs:
191191
${{ runner.os }}-node-${{ env.NODE }}-
192192
193193
- name: Install LSF & set version.py
194-
run: ./deploy/prebuild.sh
194+
run: ./deploy/prebuild_wo_frontend.sh
195195
env:
196196
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
197197

@@ -201,7 +201,7 @@ jobs:
201201
- name: Run functional tests
202202
run: |
203203
cd label_studio/
204-
pytest --junitxml report.xml --cov=. -vv
204+
pytest --junitxml report.xml --cov=. -vv -n auto
205205
206206
- name: "Upload coverage to Codecov"
207207
uses: codecov/[email protected]
@@ -275,12 +275,14 @@ jobs:
275275
collect_analytics: 0
276276
run: |
277277
cd label_studio/
278-
coverage run -m pytest
278+
python -m pytest -vv -n auto
279+
# coverage run -m pytest -n auto
279280

280-
- name: Collect coverage results
281-
if: always()
282-
env:
283-
collect_analytics: 0
284-
run: |
285-
cd label_studio/
286-
coverage report -i -m --fail-under=40
281+
282+
# - name: Collect coverage results
283+
# if: always()
284+
# env:
285+
# collect_analytics: 0
286+
# run: |
287+
# cd label_studio/
288+
# coverage report -i -m --fail-under=40

deploy/requirements-test.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
pytest==6.2.2
2-
pytest-cov==2.9.0
1+
pytest==6.2.5
2+
pytest-cov==2.12.1
33
pytest-django==4.1.0
44
pytest-mock==1.10.3
55
requests-mock==1.5.2
66
pyyaml>=5.3.1
77
moto==1.3.16.dev122
8-
tavern==1.14.0
8+
tavern==1.19.0
99
fakeredis==1.5.0
1010
pytest-env==0.6.2
1111
responses==0.13.0
12+
pytest-xdist~=2.5.0

deploy/requirements.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ attr==0.3.1
44
attrs>=19.2.0
55
pyyaml>=5.3.1
66
azure-storage-blob>=12.6.0
7-
boto==2.49.0
8-
boto3==1.16.28
9-
botocore==1.19.28
7+
8+
boto~=2.49.0
9+
boto3~=1.16.28
10+
botocore~=1.19.28
1011

1112
google-api-core==1.31.5
1213
google-auth==1.35.0
1314
google-cloud-appengine-logging==1.1.0
1415
google-cloud-audit-log==0.2.0
1516
google-cloud-core==1.5.0
16-
google-cloud-logging==2.7.0
17-
google-cloud-storage==1.29.0
17+
google-cloud-storage~=1.29.0
18+
google-cloud-logging~=2.7.0
1819
google-resumable-media==0.5.1
1920
googleapis-common-protos==1.52.0
2021
grpc-google-iam-v1==0.12.3
@@ -57,5 +58,5 @@ redis>=3.5.0
5758
sentry-sdk>=1.1.0
5859
launchdarkly-server-sdk==7.3.0
5960

60-
label-studio-converter==0.0.38
61+
label-studio-converter==0.0.39
6162
label-studio-tools==0.0.0.dev11

label_studio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
package_name = 'label-studio'
55

66
# Package version
7-
__version__ = '1.4'
7+
__version__ = '1.4.1post1'
88

99
# pypi info
1010
__latest_version__ = None

label_studio/core/utils/common.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
from collections import defaultdict
3838

3939
from base64 import b64encode
40-
from lockfile import LockFile
4140
from datetime import datetime
4241
from appdirs import user_cache_dir
4342
from functools import wraps
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Generated by Django 3.1.14 on 2022-02-11 22:18
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('projects', '0015_merge_20220117_0749'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='project',
15+
name='min_annotations_to_start_training',
16+
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'),
17+
),
18+
migrations.RemoveField(
19+
model_name='project',
20+
name='parsed_label_config',
21+
),
22+
migrations.AddField(
23+
model_name='project',
24+
name='parsed_label_config',
25+
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'),
26+
),
27+
]

label_studio/projects/models.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ class SkipQueue(models.TextChoices):
125125
default='<View></View>',
126126
help_text='Label config in XML format. See more about it in documentation',
127127
)
128-
parsed_label_config = models.TextField(
128+
parsed_label_config = models.JSONField(
129129
_('parsed label config'),
130130
blank=True,
131131
null=True,
132-
default='',
132+
default=None,
133133
help_text='Parsed label config in JSON format. See more about it in documentation',
134134
)
135135
expert_instruction = models.TextField(
@@ -550,18 +550,20 @@ def get_updated_weights(self):
550550

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

554-
if self.label_config and (self._label_config_has_changed() or not exists or not self.control_weights):
555-
self.control_weights = self.get_updated_weights()
556-
super(Project, self).save(*args, **kwargs)
557-
project_with_config_just_created = not exists and self.pk and self.label_config
558555
if self._label_config_has_changed() or project_with_config_just_created:
559556
self.data_types = extract_data_types(self.label_config)
560557
self.parsed_label_config = parse_config(self.label_config)
561558

559+
if self.label_config and (self._label_config_has_changed() or not exists or not self.control_weights):
560+
self.control_weights = self.get_updated_weights()
561+
562562
if self._label_config_has_changed():
563563
self.__original_label_config = self.label_config
564564

565+
super(Project, self).save(*args, **kwargs)
566+
565567
if not exists:
566568
steps = ProjectOnboardingSteps.objects.all()
567569
objs = [ProjectOnboarding(project=self, step=step) for step in steps]
@@ -710,6 +712,7 @@ def get_control_tags_from_config(self):
710712
def get_parsed_config(self):
711713
if self.parsed_label_config:
712714
return self.parsed_label_config
715+
713716
return parse_config(self.label_config)
714717

715718
def get_counters(self):

setup.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@
44
import label_studio
55
import sys
66

7-
# python 3.9 warning
8-
if sys.version_info[0] == 3 and sys.version_info[1] >= 9:
9-
print()
10-
print('~========================================================~')
11-
print('| Your python version is %i.%i and Label Studio has a |' % (sys.version_info[0], sys.version_info[1]))
12-
print('| lot of installation problems with this Python version. |')
13-
print('| Please use Python 3.6 - 3.8 to avoid problems with |')
14-
print('| your installation. |')
15-
print('~========================================================~')
16-
print()
17-
187
print(label_studio.package_name, label_studio.__version__)
198

209
# Readme

0 commit comments

Comments
 (0)