Skip to content

Commit b932cd8

Browse files
Merge branch 'main' into merge/lts-to-main
2 parents 458465e + 6cec665 commit b932cd8

File tree

263 files changed

+3402
-3674
lines changed

Some content is hidden

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

263 files changed

+3402
-3674
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- uses: actions/checkout@v4
9-
- uses: actions/setup-python@v5
9+
- uses: actions/setup-python@v6
1010
with:
11-
python-version: 3.9
11+
python-version: "3.10"
1212
cache: "pip"
1313
- uses: pre-commit/action@v3.0.1
1414

1515
pylint:
1616
runs-on: ubuntu-latest
1717
name: Pylint test
1818
strategy:
19+
fail-fast: false
1920
matrix:
20-
python-version: ["3.9", "3.12"]
21+
python-version: ["3.10", "3.12", "3.13"]
2122
steps:
2223
- uses: actions/checkout@v4
2324
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v5
25+
uses: actions/setup-python@v6
2526
with:
2627
python-version: ${{ matrix.python-version }}
2728
cache: "pip"
@@ -36,11 +37,12 @@ jobs:
3637
pyright:
3738
runs-on: ubuntu-latest
3839
strategy:
40+
fail-fast: false
3941
matrix:
40-
version: ["3.9", "3.12"]
42+
version: ["3.10", "3.12", "3.13"]
4143
steps:
4244
- uses: actions/checkout@v4
43-
- uses: actions/setup-python@v5
45+
- uses: actions/setup-python@v6
4446
with:
4547
python-version: ${{ matrix.version }}
4648
cache: "pip"
@@ -49,27 +51,30 @@ jobs:
4951
python -m pip install --upgrade pip
5052
pip install -e ".[dev]"
5153
- name: Run pyright
52-
run: pyright .
54+
run: pyright src/kili
5355

5456
unit-integration-test:
5557
timeout-minutes: 15
5658
name: Unit and integration tests
5759
strategy:
60+
fail-fast: false
5861
matrix:
5962
include:
6063
- os: ubuntu-latest
61-
python-version: 3.9
64+
python-version: "3.10"
6265
- os: windows-latest
63-
python-version: 3.9
66+
python-version: "3.10"
6467
- os: ubuntu-latest
65-
python-version: 3.12
68+
python-version: "3.12"
69+
- os: ubuntu-latest
70+
python-version: "3.13"
6671
runs-on: ${{ matrix.os }}
6772
steps:
6873
- name: Checkout repo
6974
uses: actions/checkout@v4
7075

7176
- name: Set up Python ${{ matrix.python-version }}
72-
uses: actions/setup-python@v5
77+
uses: actions/setup-python@v6
7378
with:
7479
python-version: ${{ matrix.python-version }}
7580
cache: "pip"
@@ -86,22 +91,29 @@ jobs:
8691
timeout-minutes: 10
8792
runs-on: ubuntu-latest
8893
steps:
89-
- uses: actions/checkout@v4
90-
- uses: lycheeverse/lychee-action@v1.9.3
94+
- uses: actions/checkout@v5
95+
- name: Convert ipynb to markdown
96+
shell: bash
97+
run: |
98+
pip install --quiet nbconvert
99+
# Find all .ipynb files under recipes/ and subfolders and convert them to .md
100+
find recipes -type f -name '*.ipynb' -print0 | while IFS= read -r -d '' file; do
101+
echo "Converting $file"
102+
jupyter nbconvert --to markdown "$file"
103+
done
104+
- uses: lycheeverse/lychee-action@v2
91105
with:
92-
fail: true
93-
debug: false
94-
args: "-qq --no-progress --insecure './**/*.md' './src/kili/**/*.py'"
106+
args: "-qq --no-progress --insecure --accept 200,201,202,203,204,206,207,208,226,301,302,307,308 --max-redirects 5 './**/*.md'"
95107

96108
build-test:
97109
runs-on: ubuntu-latest
98110
steps:
99111
- uses: actions/checkout@v4
100112

101113
- name: Set up Python
102-
uses: actions/setup-python@v5
114+
uses: actions/setup-python@v6
103115
with:
104-
python-version: 3.9
116+
python-version: "3.10"
105117
cache: "pip"
106118

107119
- name: Install dependencies
@@ -129,9 +141,9 @@ jobs:
129141
- uses: actions/checkout@v4
130142

131143
- name: Set up Python
132-
uses: actions/setup-python@v5
144+
uses: actions/setup-python@v6
133145
with:
134-
python-version: 3.9
146+
python-version: "3.10"
135147
cache: "pip"
136148

137149
- name: Install dependencies

.github/workflows/deploy_doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Set up Python
4646
uses: actions/setup-python@v5
4747
with:
48-
python-version: 3.9
48+
python-version: "3.10"
4949
cache: "pip"
5050

5151
- name: Install dependencies

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Python
1717
uses: actions/setup-python@v5
1818
with:
19-
python-version: 3.9
19+
python-version: "3.10"
2020
cache: "pip"
2121

2222
- name: Install dependencies
@@ -48,7 +48,7 @@ jobs:
4848
fi
4949
5050
- name: Publish to PyPI
51-
uses: pypa/gh-action-pypi-publish@v1.12.4
51+
uses: pypa/gh-action-pypi-publish@v1.13.0
5252
with:
5353
verbose: true
5454

.lycheeignore

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
^(http|https)://cloud.kili-technology.com/api/label/v2/graphql$
2-
https://my-custom-url-publicly-accessible/
3-
https://to/second/asset.png
4-
jane.doe@test.com
5-
john@doe.com
6-
john.doe@test.com
7-
https://tagtog.com/JaqenNLP/ApartmentReview
8-
https://tagtog.com/JaqenNLP/ApartmentReviews/-settings
9-
https://platform.openai.com/docs/models/overview
1+
# Ignore localhost and local network addresses
2+
http://localhost:*
3+
http://127.0.0.1:*
4+
5+
# Ignore GraphQL endpoints (they return 400 for GET requests)
6+
http://localhost:4001/api/label/v2/graphql*
7+
https://cloud.kili-technology.com/api/label/v2/graphql*
8+
9+
# Ignore OpenAI documentation (403 errors due to bot protection)
10+
https://help.openai.com/*
11+
https://platform.openai.com/*

.pylintrc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ persistent=yes
8888

8989
# Minimum Python version to use for version dependent checks. Will default to
9090
# the version used to run pylint.
91-
py-version=3.9
91+
py-version=3.10
9292

9393
# Discover python modules and packages in the file system subtree.
9494
recursive=no
@@ -99,10 +99,6 @@ recursive=no
9999
# source root.
100100
source-roots=
101101

102-
# When enabled, pylint would attempt to guess common misconfiguration and emit
103-
# user-friendly hints instead of false-positive error messages.
104-
suggestion-mode=yes
105-
106102
# Allow loading of arbitrary C extensions. Extensions are imported into the
107103
# active Python interpreter and may run arbitrary code.
108104
unsafe-load-any-extension=no
@@ -437,6 +433,7 @@ disable=raw-checker-failed,
437433
too-few-public-methods,
438434
too-many-ancestors,
439435
too-many-arguments,
436+
too-many-positional-arguments,
440437
too-many-instance-attributes,
441438
too-many-locals,
442439
fixme,

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Set up the Development environment
44

5-
To install the development environment, please follow these steps, preferably in a Python 3.9 virtual environment.
5+
To install the development environment, please follow these steps, preferably in a Python 3.10 virtual environment.
66

77
```bash
88
pip install -e ".[dev]"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Kili Python SDK
22

3-
[![Python 3.9](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)](https://www.python.org/)
3+
[![Python 3.10](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue)](https://www.python.org/)
44
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
55
![GitHub release (latest by date)](https://img.shields.io/github/v/release/kili-technology/kili-python-sdk?label=pypi%20package)
66

@@ -36,7 +36,7 @@ It comes with several [tutorials](https://python-sdk-docs.kili-technology.com/la
3636

3737
## Requirements
3838

39-
- Python >= 3.9
39+
- Python >= 3.10
4040
- Create and copy a [Kili API key](https://docs.kili-technology.com/docs/creating-an-api-key)
4141
- Add the `KILI_API_KEY` variable in your bash environment (or in the settings of your favorite IDE) by pasting the API key value you copied above:
4242

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Kili Python SDK has been designed to perform complex project-related tasks by us
1414

1515
## Requirements
1616

17-
You only need Python 3.9 or higher.
17+
You only need Python 3.10 or higher.
1818

1919
## Installation
2020

docs/sdk/tutorials/finetuning_dinov2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ We can then prepare the assets to be uploaded to Kili:
188188
# sort the assets by alternating between classes so that both
189189
# classes show up in the first page of the labeling interface
190190
content_array = []
191-
iterator = zip((data_dir / "def_front").iterdir(), (data_dir / "ok_front").iterdir())
191+
iterator = zip((data_dir / "def_front").iterdir(), (data_dir / "ok_front").iterdir(), strict=False)
192192
for filepath_def, filepath_ok in iterator:
193193
content_array.append(filepath_def)
194194
content_array.append(filepath_ok)

docs/sdk/tutorials/importing_coco.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -548,17 +548,15 @@ Below, we import some useful functions to convert annotations to Kili label form
548548

549549

550550
```python
551-
from typing import Dict, List
552-
553551
from kili.utils.labels.bbox import bbox_points_to_normalized_vertices, point_to_normalized_point
554552
from kili.utils.labels.image import mask_to_normalized_vertices
555553
```
556554

557555

558556
```python
559557
def coco_bbox_annotation_to_normalized_vertices(
560-
coco_ann: Dict, *, img_width: int, img_height: int
561-
) -> List[Dict]:
558+
coco_ann: dict, *, img_width: int, img_height: int
559+
) -> list[dict]:
562560
x, y, width, height = coco_ann["bbox"]
563561
ret = bbox_points_to_normalized_vertices(
564562
bottom_left={"x": x, "y": y + height},
@@ -575,8 +573,8 @@ def coco_bbox_annotation_to_normalized_vertices(
575573

576574
```python
577575
def coco_segm_annotation_to_normalized_vertices(
578-
coco_ann: Dict, *, img_width: int, img_height: int
579-
) -> List[List[Dict]]:
576+
coco_ann: dict, *, img_width: int, img_height: int
577+
) -> list[list[dict]]:
580578
coco_segmentations = coco_ann["segmentation"]
581579

582580
ret = []
@@ -590,7 +588,7 @@ def coco_segm_annotation_to_normalized_vertices(
590588
img_width=img_width,
591589
origin_location="top_left",
592590
)
593-
for x, y in zip(coco_segm[::2], coco_segm[1::2])
591+
for x, y in zip(coco_segm[::2], coco_segm[1::2], strict=False)
594592
]
595593
ret.append(vertices)
596594

@@ -706,6 +704,7 @@ for image_id in external_id_array:
706704
keypoints[1::3],
707705
keypoints[2::3],
708706
person_keypoints_val2017["categories"][0]["keypoints"],
707+
strict=False,
709708
):
710709
if x == y == visibility == 0:
711710
continue

0 commit comments

Comments
 (0)