Skip to content

Commit 6b25607

Browse files
chore: drop python 3.9
1 parent 451906b commit 6b25607

File tree

9 files changed

+26
-42
lines changed

9 files changed

+26
-42
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- uses: actions/checkout@v4
99
- uses: actions/setup-python@v5
1010
with:
11-
python-version: 3.9
11+
python-version: "3.10"
1212
cache: "pip"
1313
- uses: pre-commit/action@v3.0.1
1414

@@ -17,7 +17,7 @@ jobs:
1717
name: Pylint test
1818
strategy:
1919
matrix:
20-
python-version: ["3.9", "3.12"]
20+
python-version: ["3.10", "3.12"]
2121
steps:
2222
- uses: actions/checkout@v4
2323
- name: Set up Python ${{ matrix.python-version }}
@@ -37,7 +37,7 @@ jobs:
3737
runs-on: ubuntu-latest
3838
strategy:
3939
matrix:
40-
version: ["3.9", "3.12"]
40+
version: ["3.10", "3.12"]
4141
steps:
4242
- uses: actions/checkout@v4
4343
- uses: actions/setup-python@v5
@@ -58,11 +58,11 @@ jobs:
5858
matrix:
5959
include:
6060
- os: ubuntu-latest
61-
python-version: 3.9
61+
python-version: "3.10"
6262
- os: windows-latest
63-
python-version: 3.9
63+
python-version: "3.10"
6464
- os: ubuntu-latest
65-
python-version: 3.12
65+
python-version: "3.12"
6666
runs-on: ${{ matrix.os }}
6767
steps:
6868
- name: Checkout repo
@@ -108,7 +108,7 @@ jobs:
108108
- name: Set up Python
109109
uses: actions/setup-python@v5
110110
with:
111-
python-version: 3.9
111+
python-version: "3.10"
112112
cache: "pip"
113113

114114
- name: Install dependencies
@@ -138,7 +138,7 @@ jobs:
138138
- name: Set up Python
139139
uses: actions/setup-python@v5
140140
with:
141-
python-version: 3.9
141+
python-version: "3.10"
142142
cache: "pip"
143143

144144
- name: Install dependencies

.github/workflows/deploy_doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Set up Python
4141
uses: actions/setup-python@v5
4242
with:
43-
python-version: 3.9
43+
python-version: "3.10"
4444
cache: "pip"
4545

4646
- name: Install dependencies

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
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

.pylintrc

Lines changed: 1 addition & 1 deletion
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

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

pyproject.toml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description = "Python client for Kili Technology labeling tool"
88
readme = "README.md"
99
authors = [{ name = "Kili Technology", email = "contact@kili-technology.com" }]
1010
license = { file = "LICENSE.txt" }
11-
requires-python = ">=3.9"
11+
requires-python = ">=3.10"
1212
classifiers = [
1313
"Intended Audience :: Science/Research",
1414
"Intended Audience :: Developers",
@@ -21,7 +21,6 @@ classifiers = [
2121
"Operating System :: Unix",
2222
"Operating System :: MacOS",
2323
"Programming Language :: Python :: 3",
24-
"Programming Language :: Python :: 3.9",
2524
"Programming Language :: Python :: 3.10",
2625
"Programming Language :: Python :: 3.11",
2726
"Programming Language :: Python :: 3.12",
@@ -88,8 +87,7 @@ dev = [
8887
"opencv-python >= 4.0.0, < 5.0.0",
8988
"azure-storage-blob >= 12.0.0, < 13.0.0",
9089
# optional dependencies gis
91-
"pyproj >= 2.6.1, < 3; python_version < '3.9'",
92-
"pyproj == 3.6.1; python_version >= '3.9'",
90+
"pyproj == 3.7.1",
9391
"shapely >= 1.8, < 3",
9492
# optional dependencies - cli
9593
"tabulate >= 0.9.0, < 0.10.0",
@@ -104,8 +102,7 @@ all = [
104102
"kili-formats[all] == 0.2.10",
105103
"opencv-python >= 4.0.0, < 5.0.0",
106104
"Pillow >=9.0.0, <11.0.0",
107-
"pyproj == 3.6.1; python_version >= '3.9'",
108-
"pyproj >= 2.6.1, < 3; python_version < '3.9'",
105+
"pyproj == 3.7.1",
109106
"pyyaml >= 6.0, < 7.0",
110107
"shapely >= 1.8, < 3",
111108
"tabulate >= 0.9.0, < 0.10.0"
@@ -118,8 +115,7 @@ coco = [
118115
"kili-formats[coco] == 0.2.10"
119116
]
120117
gis = [
121-
"pyproj >= 2.6.1, < 3; python_version < '3.9'",
122-
"pyproj == 3.6.1; python_version >= '3.9'",
118+
"pyproj == 3.7.1",
123119
"shapely >= 1.8, < 3"
124120
]
125121
image = [
@@ -137,14 +133,14 @@ yolo = [
137133

138134
[tool.pyright]
139135
exclude = ["**/__pycache__", ".github/scripts/upload_test_stats_datadog.py"]
140-
pythonVersion = "3.9"
136+
pythonVersion = "3.10"
141137
typeCheckingMode = "basic"
142138

143139
[tool.ruff]
144140
select = ["ALL"]
145141
src = ["src"]
146142
line-length = 100
147-
target-version = "py38"
143+
target-version = "py310"
148144
extend-include = ["*.ipynb"]
149145
ignore = [
150146
"ANN101", # missing type for `self`

src/kili/utils/bucket.py

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
import itertools
44
import os
5-
import sys
6-
from typing import List, Union
5+
from typing import Union
76
from urllib.parse import parse_qs, urlparse
87

98
import cuid
@@ -22,7 +21,7 @@ def generate_unique_id() -> str:
2221

2322

2423
# pylint: disable=missing-type-doc
25-
def request_signed_urls(kili, file_urls: List[str]) -> List[str]:
24+
def request_signed_urls(kili, file_urls: list[str]) -> list[str]:
2625
"""Get upload signed URLs.
2726
2827
Args:
@@ -59,20 +58,9 @@ def upload_data_via_rest(
5958
url_to_use_for_upload = url_with_id.split("&id=")[0]
6059
if "blob.core.windows.net" in url_to_use_for_upload:
6160
headers["x-ms-blob-type"] = "BlockBlob"
62-
try:
63-
# Do we not put a timeout here because it can take an arbitrary long time (ML-1395)
64-
response = http_client.put(url_to_use_for_upload, data=data, headers=headers)
65-
except OverflowError as error:
66-
python_version = (
67-
f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
68-
)
69-
raise ValueError(
70-
f"Unable to upload file larger than 2GB with Python {python_version}. "
71-
f"This is caused by a known Python SSL limitation in versions ≤3.9 (Python bug #42853). "
72-
f"To fix this issue, please upgrade to Python 3.10 or later. "
73-
f"Alternatively, compress your file or split it into smaller chunks before uploading. "
74-
f"For more details, see: https://bugs.python.org/issue42853"
75-
) from error
61+
# Do we not put a timeout here because it can take an arbitrary long time (ML-1395)
62+
response = http_client.put(url_to_use_for_upload, data=data, headers=headers)
63+
7664
response.raise_for_status()
7765
return url_with_id
7866

0 commit comments

Comments
 (0)