|
1 | 1 | from setuptools import setup, find_packages |
2 | | -import sys |
3 | 2 | import pathlib |
4 | | -import platform |
5 | 3 |
|
6 | 4 | parent = pathlib.Path(__file__).parent |
7 | 5 | # get the readme for use in our long description |
8 | 6 | readme = (parent / "README.md").read_text() |
9 | 7 |
|
10 | | -python_version = platform.python_version().rsplit('.', maxsplit=1)[0] |
11 | | - |
12 | | -mac_v, _, _ = platform.mac_ver() |
13 | | -if mac_v != '': |
14 | | - mac_v_split = mac_v.split('.') |
15 | | - mac_major_version = mac_v_split[0] |
16 | | - mac_minor_version = mac_v_split[1] |
17 | | - mac_version = '.'.join([mac_major_version, mac_minor_version]) |
18 | | -else: |
19 | | - mac_major_version = None |
20 | | - mac_version = None |
21 | | - |
22 | 8 | requirements = [ |
23 | | - "pillow~=8.4.0", |
| 9 | + "pillow~=9.0.1", |
24 | 10 | "requests", |
25 | | - "matplotlib~=3.4.3", |
| 11 | + "matplotlib~=3.5.1", |
26 | 12 | ] |
27 | | -tf_req = "tensorflow~=2.5.0;platform_machine!='armv7l'" |
28 | | -onnx_req = "onnxruntime~=1.8.1;platform_machine!='armv7l'" |
29 | | -tflite_req = None |
30 | | - |
31 | | -# get the right TF Lite runtime packages based on OS and python version: https://www.tensorflow.org/lite/guide/python#install_just_the_tensorflow_lite_interpreter |
32 | | -tflite_python = None |
33 | | -tflite_platform = None |
34 | | -tflite_machine = None |
35 | | - |
36 | | -# get the right python string for the version |
37 | | -if python_version == '3.6': |
38 | | - tflite_python = 'cp36-cp36m' |
39 | | -elif python_version == '3.7': |
40 | | - tflite_python = 'cp37-cp37m' |
41 | | -elif python_version == '3.8': |
42 | | - tflite_python = 'cp38-cp38' |
43 | | -elif python_version == '3.9': |
44 | | - tflite_python = 'cp39-cp39' |
45 | | - |
46 | | -# get the right platform and machine strings for the tflite_runtime wheel URL |
47 | | -sys_platform = sys.platform.lower() |
48 | | -machine = platform.machine().lower() |
49 | | -if sys_platform == 'linux': |
50 | | - tflite_platform = sys_platform |
51 | | - tflite_machine = machine |
52 | | -elif sys_platform == 'win32': |
53 | | - tflite_platform = 'win' |
54 | | - tflite_machine = machine |
55 | | -elif sys_platform == 'darwin' and machine == 'x86_64': |
56 | | - if mac_version == '10.15': |
57 | | - tflite_platform = 'macosx_10_15' |
58 | | - elif mac_major_version == '11': |
59 | | - tflite_platform = 'macosx_11_0' |
60 | | - tflite_machine = machine |
61 | | - |
62 | | -# add it to the requirements, or print the location to find the version to install |
63 | | -if tflite_python and tflite_platform and tflite_machine: |
64 | | - tflite_req = f"tflite_runtime @ https://github.com/google-coral/pycoral/releases/download/v2.0.0/tflite_runtime-2.5.0.post1-{tflite_python}-{tflite_platform}_{tflite_machine}.whl" |
65 | | -else: |
66 | | - print( |
67 | | - f"Couldn't find tflite_runtime for your platform {sys.platform}, machine {platform.machine()}, python version {python_version}, and mac version {mac_version}. If you are trying to use TensorFlow Lite, please see the install guide for the right version: https://www.tensorflow.org/lite/guide/python#install_just_the_tensorflow_lite_interpreter" |
68 | | - ) |
| 13 | +tf_req = "tensorflow~=2.8.0 ; platform_machine != 'armv7l'" |
| 14 | +onnx_req = "onnxruntime~=1.10.0 ; platform_machine != 'armv7l' and python_version <= '3.9'" # onnxruntime not to 3.10 yet |
| 15 | +tflite_req = "tflite-runtime~=2.7.0 ; platform_system == 'Linux' and python_version <= '3.9'" # tflite not to 3.10 yet |
69 | 16 |
|
70 | 17 | setup( |
71 | 18 | name="lobe", |
72 | | - version="0.6.1", |
| 19 | + version="0.6.2", |
73 | 20 | description="Lobe Python SDK", |
74 | 21 | long_description=readme, |
75 | 22 | long_description_content_type="text/markdown", |
| 23 | + keywords='lobe ai machine learning', |
76 | 24 | url="https://github.com/lobe/lobe-python", |
77 | 25 | license="MIT", |
78 | 26 | packages=find_packages("src"), |
79 | 27 | package_dir={"": "src"}, |
80 | 28 | install_requires=requirements, |
81 | 29 | extras_require={ |
82 | | - 'all': [tf_req, onnx_req], |
| 30 | + 'all': [tf_req, onnx_req, tflite_req], |
83 | 31 | 'tf': [tf_req], |
84 | 32 | 'onnx': [onnx_req], |
85 | | - } |
| 33 | + 'tflite': [tflite_req], |
| 34 | + }, |
| 35 | + python_requires='>=3.7', |
| 36 | + classifiers=sorted([ |
| 37 | + 'Development Status :: 4 - Beta', |
| 38 | + 'Intended Audience :: Developers', |
| 39 | + 'Intended Audience :: Education', |
| 40 | + 'Intended Audience :: Science/Research', |
| 41 | + 'License :: OSI Approved :: MIT License', |
| 42 | + 'Programming Language :: Python :: 3', |
| 43 | + 'Programming Language :: Python :: 3.7', |
| 44 | + 'Programming Language :: Python :: 3.8', |
| 45 | + 'Programming Language :: Python :: 3.9', |
| 46 | + 'Programming Language :: Python :: 3.10', |
| 47 | + 'Programming Language :: Python :: 3 :: Only', |
| 48 | + 'Topic :: Scientific/Engineering', |
| 49 | + 'Topic :: Scientific/Engineering :: Mathematics', |
| 50 | + 'Topic :: Scientific/Engineering :: Artificial Intelligence', |
| 51 | + 'Topic :: Software Development', |
| 52 | + 'Topic :: Software Development :: Libraries', |
| 53 | + 'Topic :: Software Development :: Libraries :: Python Modules', |
| 54 | + ]), |
86 | 55 | ) |
0 commit comments