Skip to content

Commit 8fc6cad

Browse files
committed
Intial compability with python 3.12
1 parent 44d42ef commit 8fc6cad

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# core components
22
defusedxml>=0.7.1
3-
numpy>=1.16.6,<2.1.0
3+
numpy>=1.16.6,<2.1.0;python_version<"3.12"
4+
numpy>=1.26.0,<2.3.0;python_version>="3.12"
45
openvino-telemetry>=2023.2.1
56
PyYAML>=5.4.1
67
pillow>=8.1.2
8+
packaging

tools/accuracy_checker/requirements-extra.in

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
tqdm>=4.54.1
33

44
# image reading and preprocessing
5+
opencv-python==4.5.4.60;python_version<"3.12"
6+
opencv-python==4.10.0.84;python_version>="3.12"
57
# nncf's upperbound: https://github.com/openvinotoolkit/nncf/blob/1de67217adf60a29afa310edf4a5f4d36314446a/setup.py#L104
68
networkx<3.6
7-
scikit-image>=0.19.2
9+
scikit-image==0.18.3;python_version<"3.12"
10+
scikit-image==0.24.0;python_version>="3.12"
811

912
imagecodecs~=2022.2.22;python_version<="3.10"
1013
imagecodecs~=2024.6.1;python_version>="3.11"
@@ -38,7 +41,6 @@ nltk>=3.5
3841
# DNA sequence matching
3942
parasail>=1.2.4;platform_system!="Windows"
4043
parasail~=1.2.4;platform_system=="Windows"
41-
fast-ctc-decode>=0.2.5;python_version<"3.11"
4244

4345
# raw image formats processing
4446
rawpy>=0.17.1
@@ -47,7 +49,11 @@ rawpy>=0.17.1
4749
lmdb>=1.2.1
4850

4951
# pandas datasets support
50-
pandas>=1.1.5,<2.1
52+
pandas>=1.1.5,<2.3
5153

5254
# word-based representations of numbers
53-
inflect>=7.4.0
55+
inflect>=7.3.0
56+
57+
# visualization
58+
matplotlib==3.8.4;python_version<"3.12"
59+
matplotlib==3.9.3;python_version>="3.12"

tools/accuracy_checker/setup.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import warnings
2222
import platform
2323
import subprocess # nosec B404 # disable import-subprocess check
24-
from distutils.version import LooseVersion
24+
from packaging.version import Version
2525
from pathlib import Path
2626
from setuptools import find_packages, setup # pylint:disable=W9902
2727
from setuptools.command.test import test as test_command # pylint:disable=W9902
@@ -55,7 +55,7 @@ def read(*path):
5555
def check_and_update_numpy(min_acceptable='1.15'):
5656
try:
5757
import numpy as np # pylint:disable=C0415
58-
update_required = LooseVersion(np.__version__) < LooseVersion(min_acceptable)
58+
update_required = Version(np.__version__) < Version(min_acceptable)
5959
except ImportError:
6060
update_required = True
6161
if update_required:
@@ -106,6 +106,12 @@ def prepare_requirements():
106106
check_and_update_numpy()
107107

108108

109+
110+
_extras = _extras + ['pycocotools>=2.0.2', 'torch>=0.4.0', 'torchvision>=0.2.1', 'lpips', 'soundfile', "torchmetrics", "diffusers"]
111+
if sys.version_info.major == 3 and sys.version_info.minor < 12:
112+
_extras.append('crf_beam;platform_system=="Linux"')
113+
_extras.append('kenlm @ git+https://github.com/kpu/kenlm.git@4cb443e60b7bf2c0ddf3c745378f76cb59e254e5#egg=kenlm')
114+
109115
setup(
110116
name="accuracy_checker",
111117
description="Deep Learning Accuracy validation framework",
@@ -121,6 +127,5 @@ def prepare_requirements():
121127
install_requires=_requirements,
122128
tests_require=[read("requirements-test.in")],
123129
cmdclass={'test': PyTest, 'install_core': CoreInstall},
124-
extras_require={'extra': _extras + ['pycocotools>=2.0.2', 'crf_beam;platform_system=="Linux"', 'torch>=0.4.0', 'torchvision>=0.2.1', 'lpips', 'soundfile', "torchmetrics", "diffusers",
125-
'kenlm @ git+https://github.com/kpu/kenlm.git@4cb443e60b7bf2c0ddf3c745378f76cb59e254e5#egg=kenlm']}
130+
extras_require={'extra': _extras}
126131
)

0 commit comments

Comments
 (0)