Skip to content

Vb/remove p3.8 plt 502 #1847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/actions/lbox-matrix/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26811,11 +26811,6 @@ const core = __nccwpck_require__(8611);
try {
const files = JSON.parse(core.getInput('files-changed'));
const startingMatrix = [
{
"python-version": "3.8",
"api-key": "STAGING_LABELBOX_API_KEY_2",
"da-test-key": "DA_GCP_LABELBOX_API_KEY"
},
{
"python-version": "3.9",
"api-key": "STAGING_LABELBOX_API_KEY_3",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lbox-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
- uses: ./.github/actions/python-package-shared-setup
with:
rye-version: ${{ vars.RYE_VERSION }}
python-version: '3.8'
python-version: '3.9'
- name: Create build
id: create-build
working-directory: libs/${{ matrix.package }}
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ jobs:
fail-fast: false
matrix:
include:
- python-version: 3.8
prod-key: PROD_LABELBOX_API_KEY_2
da-test-key: DA_GCP_LABELBOX_API_KEY
- python-version: 3.9
prod-key: PROD_LABELBOX_API_KEY_3
da-test-key: DA_GCP_LABELBOX_API_KEY
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/python-package-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Get Latest SDK versions
id: get_sdk_versions
run: |
sdk_versions=$(git tag --list --sort=-version:refname "v.*" | head -n 4 | jq -R -s -c 'split("\n")[:-1]')
sdk_versions=$(git tag --list --sort=-version:refname "v.*" | head -n 3 | jq -R -s -c 'split("\n")[:-1]')
if [ -z "$sdk_versions" ]; then
echo "No tags found"
exit 1
Expand All @@ -58,10 +58,6 @@ jobs:
fail-fast: false
matrix:
include:
- python-version: 3.8
api-key: STAGING_LABELBOX_API_KEY_2
da-test-key: DA_GCP_LABELBOX_API_KEY
sdk-version: ${{ fromJson(needs.get_sdk_versions.outputs.sdk_versions)[3] }}
- python-version: 3.9
api-key: STAGING_LABELBOX_API_KEY_3
da-test-key: DA_GCP_LABELBOX_API_KEY
Expand Down Expand Up @@ -103,7 +99,7 @@ jobs:
- uses: ./.github/actions/python-package-shared-setup
with:
rye-version: ${{ vars.RYE_VERSION }}
python-version: '3.8'
python-version: '3.9'
- name: Create build
id: create-build
working-directory: libs/labelbox
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/python-package-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ jobs:
fail-fast: false
matrix:
include:
- python-version: 3.8
api-key: PROD_LABELBOX_API_KEY_2
da-test-key: DA_GCP_LABELBOX_API_KEY
- python-version: 3.9
api-key: PROD_LABELBOX_API_KEY_3
da-test-key: DA_GCP_LABELBOX_API_KEY
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.8.18
3.9.18
6 changes: 3 additions & 3 deletions examples/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "Labelbox Python Example Notebooks"
authors = [{ name = "Labelbox", email = "docs@labelbox.com" }]
readme = "README.md"
# Python version matches labelbox SDK
requires-python = ">=3.8"
requires-python = ">=3.9"
dependencies = []

[project.urls]
Expand All @@ -22,8 +22,8 @@ dev-dependencies = [
"yapf>=0.40.2",
"black[jupyter]>=24.4.2",
"databooks>=1.3.10",
# higher versions dont support python 3.8
"pandas>=2.0.3",
# higher versions dont support python 3.9
"pandas>=2.2.3",
]

[tool.rye.scripts]
Expand Down
4 changes: 2 additions & 2 deletions libs/labelbox/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# https://github.com/ucyo/python-package-template/blob/master/Dockerfile
FROM python:3.8-slim as rye
FROM python:3.9-slim as rye

ENV LANG="C.UTF-8" \
LC_ALL="C.UTF-8" \
Expand Down Expand Up @@ -38,7 +38,7 @@ WORKDIR /home/python/labelbox-python

RUN rye config --set-bool behavior.global-python=true && \
rye config --set-bool behavior.use-uv=true && \
rye pin 3.8 && \
rye pin 3.9 && \
rye sync

CMD cd libs/labelbox && rye run integration && rye sync -f --features labelbox/data && rye run unit && rye run data
3 changes: 1 addition & 2 deletions libs/labelbox/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies = [
"lbox-clients==1.1.0",
]
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.9"
classifiers = [
# How mature is this project?
"Development Status :: 5 - Production/Stable",
Expand All @@ -29,7 +29,6 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
# Specify the Python versions you support here.
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down
3 changes: 1 addition & 2 deletions libs/labelbox/src/labelbox/annotated_types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from typing_extensions import Annotated
from typing import Annotated

from pydantic import Field


Cuid = Annotated[str, Field(min_length=25, max_length=25)]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import ABC
from io import BytesIO
from typing import Callable, Optional, Union
from typing import Callable, Literal, Optional, Union

import numpy as np
import requests
Expand All @@ -9,9 +9,6 @@
from PIL import Image
from pydantic import BaseModel, ConfigDict, model_validator
from requests.exceptions import ConnectTimeout
from typing_extensions import Literal

from pydantic import BaseModel, model_validator, ConfigDict

from ..types import TypedArray

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
from typing import Callable, Optional, Tuple, Union, Dict, List
from typing import Callable, Dict, List, Optional, Tuple, Union

import numpy as np
import cv2

import numpy as np
from pydantic import field_validator
from shapely.geometry import MultiPolygon, Polygon

from ..data import MaskData
from .geometry import Geometry

from pydantic import field_validator


class Mask(Geometry):
"""Mask used to represent a single class in a larger segmentation mask
Expand Down Expand Up @@ -91,7 +89,7 @@ def draw(
as opposed to the mask that this object references which might have multiple objects determined by colors
"""
mask = self.mask.value
mask = np.alltrue(mask == self.color, axis=2).astype(np.uint8)
mask = np.all(mask == self.color, axis=2).astype(np.uint8)

if height is not None or width is not None:
mask = cv2.resize(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from typing import Dict, Optional, Union
from typing_extensions import Annotated
from enum import Enum
from typing import Annotated, Dict, Optional, Union

from pydantic import field_validator
from pydantic.types import confloat

from .base import ConfidenceValue, BaseMetric
from .base import BaseMetric, ConfidenceValue

ScalarMetricValue = Annotated[float, confloat(ge=0, le=100_000_000)]
ScalarMetricConfidenceValue = Dict[ConfidenceValue, ScalarMetricValue]
Expand Down
8 changes: 3 additions & 5 deletions libs/labelbox/src/labelbox/data/annotation_types/types.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import sys
from typing import Generic, TypeVar, Any
from typing import Annotated, Any, Generic, TypeVar

from typing_extensions import Annotated
from packaging import version
import numpy as np

from pydantic import StringConstraints, Field, ConfigDict
from packaging import version
from pydantic import ConfigDict, Field, StringConstraints
from pydantic_core import core_schema

DType = TypeVar("DType")
Expand Down
4 changes: 2 additions & 2 deletions libs/labelbox/src/labelbox/data/metrics/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal
from typing import Literal

from ..annotation_types import ClassificationAnnotation, Label, ObjectAnnotation
from ..annotation_types.feature import FeatureSchema
from ..annotation_types import ObjectAnnotation, ClassificationAnnotation, Label


def get_identifying_key(
Expand Down
3 changes: 1 addition & 2 deletions libs/labelbox/src/labelbox/project_validation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Optional, Set
from typing import Annotated, Optional, Set

from pydantic import BaseModel, ConfigDict, Field, model_validator
from typing_extensions import Annotated

from labelbox.schema.media_type import MediaType
from labelbox.schema.ontology_kind import EditorTaskType
Expand Down
32 changes: 14 additions & 18 deletions libs/labelbox/src/labelbox/schema/data_row_metadata.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# type: ignore
from datetime import datetime
import warnings
from copy import deepcopy
from datetime import datetime
from enum import Enum
from itertools import chain
import warnings

from typing import (
Annotated,
Any,
Callable,
Dict,
Generator,
List,
Optional,
Dict,
Union,
Callable,
Type,
Any,
Generator,
Union,
overload,
)
from typing_extensions import Annotated

from labelbox.schema.identifiables import DataRowIdentifiers, UniqueIds
from labelbox.schema.identifiable import UniqueId, GlobalKey
from pydantic import (
BaseModel,
BeforeValidator,
ConfigDict,
Field,
StringConstraints,
conlist,
ConfigDict,
model_serializer,
BeforeValidator,
)
from typing_extensions import Annotated

from labelbox.schema.identifiable import GlobalKey, UniqueId
from labelbox.schema.identifiables import DataRowIdentifiers, UniqueIds
from labelbox.schema.ontology import SchemaId
from labelbox.utils import (
_CamelCaseMixin,
Expand Down Expand Up @@ -424,7 +424,7 @@ def update_enum_option(
schema = self._validate_custom_schema_by_name(name)
if schema.kind != DataRowMetadataKind.enum:
raise ValueError(
f"Updating Enum option is only supported for Enum metadata schema"
"Updating Enum option is only supported for Enum metadata schema"
)
valid_options: List[str] = [o.name for o in schema.options]

Expand Down Expand Up @@ -758,10 +758,6 @@ def bulk_export(self, data_row_ids) -> List[DataRowMetadata]:
and isinstance(data_row_ids[0], str)
):
data_row_ids = UniqueIds(data_row_ids)
warnings.warn(
"Using data row ids will be deprecated. Please use "
"UniqueIds or GlobalKeys instead."
)

def _bulk_export(
_data_row_ids: DataRowIdentifiers,
Expand Down
10 changes: 1 addition & 9 deletions libs/labelbox/src/labelbox/schema/export_filters.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import sys

from datetime import datetime, timezone
from typing import Collection, Dict, Tuple, List, Optional
from labelbox.typing_imports import Literal

if sys.version_info >= (3, 8):
from typing import TypedDict
else:
from typing_extensions import TypedDict
from typing import Collection, Dict, List, Literal, Optional, Tuple, TypedDict

SEARCH_LIMIT_PER_EXPORT_V2 = 2_000
ISO_8061_FORMAT = "%Y-%m-%dT%H:%M:%S%z"
Expand Down
9 changes: 1 addition & 8 deletions libs/labelbox/src/labelbox/schema/export_params.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import sys

from typing import Optional, List
from typing import List, Optional, TypedDict

from labelbox.schema.media_type import MediaType

if sys.version_info >= (3, 8):
from typing import TypedDict
else:
from typing_extensions import TypedDict

EXPORT_LIMIT = 30


Expand Down
3 changes: 1 addition & 2 deletions libs/labelbox/src/labelbox/schema/ontology.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
import warnings
from dataclasses import dataclass, field
from enum import Enum
from typing import Any, Dict, List, Optional, Type, Union
from typing import Annotated, Any, Dict, List, Optional, Type, Union

from lbox.exceptions import InconsistentOntologyException
from pydantic import StringConstraints
from typing_extensions import Annotated

from labelbox.orm.db_object import DbObject
from labelbox.orm.model import Field, Relationship
Expand Down
8 changes: 0 additions & 8 deletions libs/labelbox/src/labelbox/schema/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1339,10 +1339,6 @@ def update_data_row_labeling_priority(

if isinstance(data_rows, list):
data_rows = UniqueIds(data_rows)
warnings.warn(
"Using data row ids will be deprecated. Please use "
"UniqueIds or GlobalKeys instead."
)

method = "createQueuePriorityUpdateTask"
priority_param = "priority"
Expand Down Expand Up @@ -1513,10 +1509,6 @@ def move_data_rows_to_task_queue(self, data_row_ids, task_queue_id: str):
"""
if isinstance(data_row_ids, list):
data_row_ids = UniqueIds(data_row_ids)
warnings.warn(
"Using data row ids will be deprecated. Please use "
"UniqueIds or GlobalKeys instead."
)

method = "createBulkAddRowsToQueueTask"
query_str = (
Expand Down
3 changes: 2 additions & 1 deletion libs/labelbox/src/labelbox/schema/project_overview.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Dict, List
from typing_extensions import TypedDict

from pydantic import BaseModel
from typing_extensions import TypedDict


class ProjectOverview(BaseModel):
Expand Down
12 changes: 8 additions & 4 deletions libs/labelbox/src/labelbox/schema/search_filters.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import datetime
from enum import Enum
from typing import List, Union
from pydantic import PlainSerializer, BaseModel, Field
from typing import Annotated, List, Union

from typing_extensions import Annotated
from pydantic import (
BaseModel,
ConfigDict,
Field,
PlainSerializer,
field_validator,
)

from pydantic import BaseModel, Field, field_validator, ConfigDict
from labelbox.schema.labeling_service_status import LabelingServiceStatus
from labelbox.utils import format_iso_datetime

Expand Down
Loading
Loading