Skip to content

Commit 30ee877

Browse files
authored
Merge branch 'develop' into addlinks-import4
2 parents 326e3c1 + 367de74 commit 30ee877

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3340
-2750
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Labelbox Python SDK Develop
2+
3+
on:
4+
push:
5+
branches: [develop]
6+
pull_request:
7+
branches: [develop]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- python-version: 3.8
16+
api-key: STAGING_LABELBOX_API_KEY_2
17+
da-test-key: DA_GCP_LABELBOX_API_KEY
18+
- python-version: 3.9
19+
api-key: STAGING_LABELBOX_API_KEY_3
20+
da-test-key: DA_GCP_LABELBOX_API_KEY
21+
- python-version: "3.10"
22+
api-key: STAGING_LABELBOX_API_KEY_4
23+
da-test-key: DA_GCP_LABELBOX_API_KEY
24+
- python-version: 3.11
25+
api-key: STAGING_LABELBOX_API_KEY
26+
da-test-key: DA_GCP_LABELBOX_API_KEY
27+
- python-version: 3.12
28+
api-key: STAGING_LABELBOX_API_KEY_5
29+
da-test-key: DA_GCP_LABELBOX_API_KEY
30+
uses: ./.github/workflows/python-package-shared.yml
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
api-key: ${{ matrix.api-key }}
34+
da-test-key: ${{ matrix.da-test-key }}
35+
fixture-profile: true
36+
test-env: 'staging'
37+
secrets: inherit
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Labelbox Python SDK Main
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- python-version: 3.8
16+
api-key: PROD_LABELBOX_API_KEY_2
17+
da-test-key: DA_GCP_LABELBOX_API_KEY
18+
- python-version: 3.9
19+
api-key: PROD_LABELBOX_API_KEY_3
20+
da-test-key: DA_GCP_LABELBOX_API_KEY
21+
- python-version: "3.10"
22+
api-key: PROD_LABELBOX_API_KEY_4
23+
da-test-key: DA_GCP_LABELBOX_API_KEY
24+
- python-version: 3.11
25+
api-key: LABELBOX_API_KEY
26+
da-test-key: DA_GCP_LABELBOX_API_KEY
27+
- python-version: 3.12
28+
api-key: PROD_LABELBOX_API_KEY_5
29+
da-test-key: DA_GCP_LABELBOX_API_KEY
30+
uses: ./.github/workflows/python-package-shared.yml
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
api-key: ${{ matrix.api-key }}
34+
da-test-key: ${{ matrix.da-test-key }}
35+
fixture-profile: false
36+
test-env: 'prod'
37+
secrets: inherit
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Labelbox Python SDK Shared
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
python-version:
7+
required: true
8+
type: string
9+
api-key:
10+
required: true
11+
type: string
12+
da-test-key:
13+
required: true
14+
type: string
15+
test-env:
16+
required: true
17+
type: string
18+
fixture-profile:
19+
required: true
20+
type: boolean
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
env:
25+
# make sure to tell tox to use these environs in tox.ini
26+
LABELBOX_TEST_API_KEY: ${{ secrets[inputs.api-key] }}
27+
DA_GCP_LABELBOX_API_KEY: ${{ secrets[inputs.da-test-key] }}
28+
LABELBOX_TEST_ENVIRON: ${{ inputs.test-env }}
29+
FIXTURE_PROFILE: ${{ inputs.fixture-profile }}
30+
steps:
31+
- name: Cancel previous workflow
32+
uses: styfle/cancel-workflow-action@0.12.1
33+
with:
34+
access_token: ${{ github.token }}
35+
36+
- uses: actions/checkout@v4
37+
with:
38+
token: ${{ secrets.ACTIONS_ACCESS_TOKEN }}
39+
ref: ${{ github.head_ref }}
40+
41+
- name: Set up Python ${{ inputs.python-version }}
42+
uses: actions/setup-python@v5
43+
with:
44+
python-version: ${{ inputs.python-version }}
45+
cache: "pip"
46+
47+
- name: yapf
48+
id: yapf
49+
uses: AlexanderMelde/yapf-action@master
50+
with:
51+
args: --verbose --recursive --parallel --style "google"
52+
- name: dependencies
53+
run: |
54+
sudo apt-get -y update
55+
sudo apt install -y libsm6 \
56+
libxext6 \
57+
ffmpeg \
58+
libfontconfig1 \
59+
libxrender1 \
60+
libgl1-mesa-glx
61+
- name: mypy
62+
run: |
63+
pip install strenum
64+
pip install mypy==1.9.0
65+
# TODO: consider installing requests typing
66+
mypy -p labelbox --pretty --show-error-codes --non-interactive --install-types
67+
- name: Install test dependencies
68+
run: |
69+
pip install tox==4.14.1
70+
# TODO: replace tox.ini with what the Makefile does
71+
# to make sure local testing is
72+
# identical to github actions which uses tox.ini
73+
- name: Test with tox (unit)
74+
run: |
75+
tox -e py -- tests/unit
76+
- name: Test with tox (integration / data)
77+
run: |
78+
tox -e py -- tests/integration tests/data

.github/workflows/python-package.yml

Lines changed: 0 additions & 106 deletions
This file was deleted.

.github/workflows/release-container.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ jobs:
4141
tags: |
4242
${{ env.CONTAINER_IMAGE }}:latest
4343
${{ env.CONTAINER_IMAGE }}:${{ github.event.release.tag_name }}
44+

.github/workflows/testing-container.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ jobs:
4242
tags: |
4343
${{ env.CONTAINER_IMAGE }}:develop
4444
${{ env.CONTAINER_IMAGE }}:${{ github.sha }}
45+

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
FROM python:3.9-slim-bullseye
1+
#https://stackoverflow.com/questions/77364550/attributeerror-module-pkgutil-has-no-attribute-impimporter-did-you-mean
2+
#https://github.com/pyproj4/pyproj/issues/1321
3+
FROM python:3.8-slim-bullseye
24

3-
RUN pip install pytest=="7.4.4" pytest-cases pytest-rerunfailures pytest-snapshot
5+
RUN pip install pytest=="7.4.4" pytest-cases pytest-rerunfailures pytest-snapshot tox mypy strenum
46
RUN apt-get -y update
57
RUN apt install -y libsm6 \
68
libxext6 \
@@ -17,3 +19,4 @@ RUN pip install -r requirements.txt
1719
COPY . /usr/src/
1820

1921
RUN python setup.py install
22+
CMD tox -e py -- tests/integration tests/data

lbx_prompt.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11930,8 +11930,12 @@ def expected_export_v2_text():
1193011930
'annotation_kind': 'TextEntity',
1193111931
'classifications': [],
1193211932
'location': {
11933-
'start': 67,
11934-
'end': 128
11933+
'start':
11934+
66,
11935+
'end':
11936+
128,
11937+
'token':
11938+
"more people to express themselves online😞😂‚, research suggests"
1193511939
}
1193611940
}],
1193711941
'classifications': [{

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[pytest]
22
pythonpath = .
3-
addopts = -rP -vvv --reruns 5 --reruns-delay 10 --durations=20 -n 20
3+
addopts = -rP -vvv --reruns 5 --reruns-delay 10 --durations=20 -n 32
44
markers =
55
slow: marks tests as slow (deselect with '-m "not slow"')

0 commit comments

Comments
 (0)