Skip to content

Commit 0e6ede3

Browse files
authored
Compatibility python 310 (#15)
* removed generics to be compatible with Python 3.10 * Downgrade minimum python to 3.10 * stated suppport for python 3.10 -> 3.14
1 parent bcc9a60 commit 0e6ede3

6 files changed

Lines changed: 20 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- "**"
77

88
env:
9-
PYTHON_VERSION: "3.12"
9+
PYTHON_VERSION: "3.10"
1010

1111
jobs:
1212
types:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This project uses [uv](https://github.com/astral-sh/uv) instead of `pip` for man
3535

3636
### Prerequisites
3737

38-
- Python >= 3.12
38+
- Python >= 3.10
3939
- [uv](https://github.com/astral-sh/uv)
4040

4141
### Steps

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
![License](https://img.shields.io/badge/license-MIT-brightgreen)
88
![Version](https://img.shields.io/badge/version-0.1.3-blue)
99
![Status](https://img.shields.io/badge/status-pre--release-orange)
10-
![Python](https://img.shields.io/badge/Python-3.12%2B-brightgreen)
10+
![Python](https://img.shields.io/badge/Python-3.10--3.14-brightgreen)
1111
![Contributions](https://img.shields.io/badge/contributions-welcome-brightgreen)
1212

1313
# Welcome to `pyvisim`!

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ license = {text = "MIT"}
1111
authors = [
1212
{name = "Nhat Huy Vu", email = "vunhathuy234@gmail.com"}
1313
]
14-
requires-python = ">=3.12"
14+
requires-python = ">=3.10"
1515
classifiers = [
1616
"Programming Language :: Python :: 3",
17+
"Programming Language :: Python :: 3.10",
18+
"Programming Language :: Python :: 3.11",
19+
"Programming Language :: Python :: 3.12",
20+
"Programming Language :: Python :: 3.13",
21+
"Programming Language :: Python :: 3.14",
1722
"Operating System :: OS Independent",
1823
]
1924
dependencies = [
@@ -62,7 +67,7 @@ fmt = [
6267
]
6368

6469
[tool.mypy]
65-
python_version = "3.12"
70+
python_version = "3.10"
6671
strict = true
6772
warn_return_any = true
6873
warn_unused_configs = true

pyvisim/encoders/_base_encoder.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from collections.abc import Callable, Iterable, Iterator, MutableSequence
44
from enum import Enum
55
from functools import wraps
6-
from typing import Any, cast
6+
from typing import Any, TypeVar, cast
77

88
import joblib
99
import numpy as np
@@ -103,7 +103,10 @@ def fallback(vecs1: np.ndarray, vecs2: np.ndarray) -> np.ndarray:
103103
) from e
104104

105105

106-
def _tupleize_first_arg[MethodT: Callable[..., Any]](func: MethodT) -> MethodT:
106+
MethodT = TypeVar("MethodT", bound=Callable[..., Any])
107+
108+
109+
def _tupleize_first_arg(func: MethodT) -> MethodT: # noqa: UP047
107110
"""
108111
# TODO: currently, the param 'image_paths' param is hardcoded. This should be more general
109112
# to be able to handle any variable name

pyvisim/features/_features.py

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

99
from collections.abc import Callable
1010
from functools import wraps
11-
from typing import Any, cast
11+
from typing import Any, TypeVar, cast
1212

1313
import cv2
1414
import numpy as np
@@ -22,7 +22,10 @@
2222
setup_logging()
2323

2424

25-
def _check_output_shape[ExtractorCallT: Callable[..., Any]](
25+
ExtractorCallT = TypeVar("ExtractorCallT", bound=Callable[..., Any])
26+
27+
28+
def _check_output_shape( # noqa: UP047
2629
func: ExtractorCallT,
2730
) -> ExtractorCallT:
2831
"""

0 commit comments

Comments
 (0)