From bcdc7a2d383d0360367467e8a8ba8163c8cad9ad Mon Sep 17 00:00:00 2001 From: rllin Date: Thu, 10 Sep 2020 17:40:52 -0700 Subject: [PATCH 01/10] also allow 36 --- Dockerfile | 2 +- labelbox/schema/project.py | 7 +++++++ setup.py | 7 +++++-- tox.ini | 3 ++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index d825f76ab..91c97e336 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3 +FROM python:3.6 COPY . /usr/src/labelbox WORKDIR /usr/src/labelbox diff --git a/labelbox/schema/project.py b/labelbox/schema/project.py index c83b2db96..2e37fb1e3 100644 --- a/labelbox/schema/project.py +++ b/labelbox/schema/project.py @@ -15,6 +15,13 @@ from labelbox.orm.model import Entity, Field, Relationship from labelbox.pagination import PaginatedCollection +try: + datetime.fromisoformat +except AttributeError: + from backports.datetime_fromisoformat import MonkeyPatch + MonkeyPatch.patch_fromisoformat() + + logger = logging.getLogger(__name__) diff --git a/setup.py b/setup.py index a5f4cbb0c..8d0f0a610 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="labelbox", - version="2.4.6", + version="2.4.7", author="Labelbox", author_email="engineering@labelbox.com", description="Labelbox Python API", @@ -15,6 +15,8 @@ packages=setuptools.find_packages(), install_requires=[ "backoff==1.10.0", + "backports-datetime-fromisoformat", + "dataclasses", "ndjson==0.3.1", "requests>=2.22.0", "google-api-core>=1.22.1", @@ -23,9 +25,10 @@ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', ], - python_requires='>=3.7', + python_requires='>=3.6', keywords=["labelbox"], ) diff --git a/tox.ini b/tox.ini index 709763dea..3297034c3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,10 @@ # content of: tox.ini , put in same dir as setup.py [tox] -envlist = py37, py38 +envlist = py36, py37, py38 [gh-actions] python = + 3.6: py36 3.7: py37 3.8: py38 From 902b712ae7ff240dc2e1d0f3131e1177e5d6f1a6 Mon Sep 17 00:00:00 2001 From: rllin Date: Thu, 10 Sep 2020 17:44:51 -0700 Subject: [PATCH 02/10] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31dc844fa..97f7c6f11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Version 2.4.7 (2020-09-10) +### Added +* `Ontology` schema for interacting with ontologies and their schema nodes + ## Version 2.4.6 (2020-09-03) ### Fix * fix failing `create_metadata` calls From e60cf241f13ebccd5a9b40ae78a8def9625cbb34 Mon Sep 17 00:00:00 2001 From: rllin Date: Thu, 10 Sep 2020 17:47:31 -0700 Subject: [PATCH 03/10] 3.6 --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 377e8c4a9..ed129d5b4 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -14,7 +14,7 @@ jobs: strategy: max-parallel: 1 matrix: - python-version: [3.7, 3.8] + python-version: [3.6, 3.7, 3.8] steps: From cb1f5d5d3de88f192b3e6b7450f9daa100f97f83 Mon Sep 17 00:00:00 2001 From: rllin Date: Thu, 10 Sep 2020 17:48:03 -0700 Subject: [PATCH 04/10] yapf --- labelbox/schema/project.py | 1 - 1 file changed, 1 deletion(-) diff --git a/labelbox/schema/project.py b/labelbox/schema/project.py index 2e37fb1e3..2da940313 100644 --- a/labelbox/schema/project.py +++ b/labelbox/schema/project.py @@ -21,7 +21,6 @@ from backports.datetime_fromisoformat import MonkeyPatch MonkeyPatch.patch_fromisoformat() - logger = logging.getLogger(__name__) From eb3477c9d8a1cb4659d47c2abf3851174a05876f Mon Sep 17 00:00:00 2001 From: rllin Date: Thu, 10 Sep 2020 21:13:23 -0700 Subject: [PATCH 05/10] ignore --- labelbox/schema/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labelbox/schema/project.py b/labelbox/schema/project.py index 2da940313..7fc4fd2e1 100644 --- a/labelbox/schema/project.py +++ b/labelbox/schema/project.py @@ -16,7 +16,7 @@ from labelbox.pagination import PaginatedCollection try: - datetime.fromisoformat + datetime.fromisoformat # type: ignore-attr-defined except AttributeError: from backports.datetime_fromisoformat import MonkeyPatch MonkeyPatch.patch_fromisoformat() From 9b247c8472131b741577571e6bc072061c2f9b6e Mon Sep 17 00:00:00 2001 From: rllin Date: Thu, 10 Sep 2020 21:17:49 -0700 Subject: [PATCH 06/10] fix ignore --- labelbox/schema/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labelbox/schema/project.py b/labelbox/schema/project.py index 7fc4fd2e1..3d387b7f8 100644 --- a/labelbox/schema/project.py +++ b/labelbox/schema/project.py @@ -16,7 +16,7 @@ from labelbox.pagination import PaginatedCollection try: - datetime.fromisoformat # type: ignore-attr-defined + datetime.fromisoformat # type: ignore[attr-defined] except AttributeError: from backports.datetime_fromisoformat import MonkeyPatch MonkeyPatch.patch_fromisoformat() From af4c492dda12181df519ff1bbe8423df18ffd913 Mon Sep 17 00:00:00 2001 From: rllin Date: Thu, 10 Sep 2020 21:31:41 -0700 Subject: [PATCH 07/10] parallel --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ed129d5b4..1b21b3377 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: - max-parallel: 1 + max-parallel: 3 matrix: python-version: [3.6, 3.7, 3.8] From 9fda2e2843912a62361148bfc04081f790ac7cc0 Mon Sep 17 00:00:00 2001 From: rllin Date: Thu, 10 Sep 2020 21:48:45 -0700 Subject: [PATCH 08/10] split --- .github/workflows/python-package.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 1b21b3377..7336b66c7 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -12,9 +12,10 @@ jobs: runs-on: ubuntu-latest strategy: - max-parallel: 3 + max-parallel: 1 matrix: python-version: [3.6, 3.7, 3.8] + group: [1, 2, 3, 4, 5] steps: @@ -57,7 +58,7 @@ jobs: mypy -p labelbox --pretty --show-error-codes - name: Install package and test dependencies run: | - pip install tox==3.18.1 tox-gh-actions==1.3.0 + pip install tox==3.18.1 tox-gh-actions==1.3.0 pytest-split # TODO: replace tox.ini with what the Makefile does # to make sure local testing is @@ -72,4 +73,4 @@ jobs: # randall+staging-python@labelbox.com LABELBOX_TEST_API_KEY_STAGING: ${{ secrets.STAGING_LABELBOX_API_KEY }} run: | - tox -- -svv + pytest --splits 5 --group ${{ matrix.group }} -svv From b53e11ff219b3f95ad8373cb8a484f93cb58c5a0 Mon Sep 17 00:00:00 2001 From: rllin Date: Thu, 10 Sep 2020 21:55:40 -0700 Subject: [PATCH 09/10] one version --- .github/workflows/python-package.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 7336b66c7..7bccc2e54 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -14,8 +14,8 @@ jobs: strategy: max-parallel: 1 matrix: - python-version: [3.6, 3.7, 3.8] - group: [1, 2, 3, 4, 5] + # TODO: unlock parallel testing by using more API keys + python-version: [3.6] steps: @@ -73,4 +73,4 @@ jobs: # randall+staging-python@labelbox.com LABELBOX_TEST_API_KEY_STAGING: ${{ secrets.STAGING_LABELBOX_API_KEY }} run: | - pytest --splits 5 --group ${{ matrix.group }} -svv + pytest -svv From efc482d1992a305d75b807fe7dc98f09a0e16c43 Mon Sep 17 00:00:00 2001 From: rllin Date: Thu, 10 Sep 2020 21:59:55 -0700 Subject: [PATCH 10/10] parallel --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 7bccc2e54..dd4572911 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -58,7 +58,7 @@ jobs: mypy -p labelbox --pretty --show-error-codes - name: Install package and test dependencies run: | - pip install tox==3.18.1 tox-gh-actions==1.3.0 pytest-split + pip install tox==3.18.1 tox-gh-actions==1.3.0 pytest-parallel==0.1.0 # TODO: replace tox.ini with what the Makefile does # to make sure local testing is @@ -73,4 +73,4 @@ jobs: # randall+staging-python@labelbox.com LABELBOX_TEST_API_KEY_STAGING: ${{ secrets.STAGING_LABELBOX_API_KEY }} run: | - pytest -svv + pytest --workers 2 -svv