|
1 | | -import sys |
2 | | -import os |
3 | | -import io |
4 | | -from setuptools import setup, find_packages |
5 | | - |
6 | | -if sys.version_info < (3, 7): |
7 | | - sys.exit('Sorry, Python < 3.7 is not supported.') |
8 | | - |
9 | | - |
10 | | -def is_raspberrypi(): |
11 | | - try: |
12 | | - with io.open('/sys/firmware/devicetree/base/model', 'r') as m: |
13 | | - if 'raspberry pi' in m.read().lower(): |
14 | | - return True |
15 | | - except Exception: |
16 | | - pass |
17 | | - return False |
18 | | - |
19 | | - |
20 | | -def is_coral(): |
21 | | - try: |
22 | | - with io.open('/sys/firmware/devicetree/base/model', 'r') as m: |
23 | | - if 'coral' in m.read().lower(): |
24 | | - return True |
25 | | - except Exception: |
26 | | - pass |
27 | | - return False |
28 | | - |
29 | | - |
30 | | -with open("README.md", "r") as fh: |
31 | | - long_description = fh.read() |
32 | | - |
33 | | -deps = ['numpy', 'Pillow', 'psutil'] |
34 | | -if is_raspberrypi(): # drone |
35 | | - deps.append(['picamera', 'yamspy==0.3.3', 'opencv-python']) |
36 | | -elif is_coral(): # drone |
37 | | - deps.append(['yamspy==0.3.3', 'opencv-python']) |
38 | | -else: # remote |
39 | | - deps.append(['opencv-contrib-python', 'pysimplegui']) |
40 | | - |
41 | | -setup(name='cognifly', |
42 | | - packages=[package for package in find_packages()], |
43 | | - version='0.3.2', |
44 | | - license='MIT', |
45 | | - description='Control the CogniFly open-source drone from python', |
46 | | - long_description=long_description, |
47 | | - long_description_content_type="text/markdown", |
48 | | - author='Yann Bouteiller', |
49 | | - url='https://github.com/thecognifly/cognifly-python', |
50 | | - download_url='https://github.com/thecognifly/cognifly-python/archive/refs/tags/v0.3.2.tar.gz', |
51 | | - keywords=['cognifly', 'drone', 'remote', 'control'], |
52 | | - install_requires=deps, |
53 | | - scripts=["scripts/cognifly-controller", ], |
54 | | - classifiers=[ |
55 | | - 'Development Status :: 4 - Beta', |
56 | | - 'Intended Audience :: Developers', |
57 | | - 'Intended Audience :: Education', |
58 | | - 'Intended Audience :: Information Technology', |
59 | | - 'Intended Audience :: Science/Research', |
60 | | - 'License :: OSI Approved :: MIT License', |
61 | | - 'Operating System :: Microsoft :: Windows', |
62 | | - 'Operating System :: POSIX :: Linux', |
63 | | - 'Programming Language :: Python', |
64 | | - 'Framework :: Robot Framework :: Library', |
65 | | - 'Topic :: Education', |
66 | | - 'Topic :: Scientific/Engineering :: Artificial Intelligence', |
67 | | - ], |
68 | | - package_data={'cognifly': [ |
69 | | - 'cognifly_remote/sprites/gamepad_off.png', |
70 | | - 'cognifly_remote/sprites/gamepad_on.png']} |
71 | | - ) |
| 1 | +import sys |
| 2 | +import os |
| 3 | +import io |
| 4 | +from setuptools import setup, find_packages |
| 5 | + |
| 6 | +if sys.version_info < (3, 7): |
| 7 | + sys.exit('Sorry, Python < 3.7 is not supported.') |
| 8 | + |
| 9 | + |
| 10 | +def is_raspberrypi(): |
| 11 | + try: |
| 12 | + with io.open('/sys/firmware/devicetree/base/model', 'r') as m: |
| 13 | + if 'raspberry pi' in m.read().lower(): |
| 14 | + return True |
| 15 | + except Exception: |
| 16 | + pass |
| 17 | + return False |
| 18 | + |
| 19 | + |
| 20 | +def is_coral(): |
| 21 | + try: |
| 22 | + with io.open('/sys/firmware/devicetree/base/model', 'r') as m: |
| 23 | + if 'coral' in m.read().lower(): |
| 24 | + return True |
| 25 | + except Exception: |
| 26 | + pass |
| 27 | + return False |
| 28 | + |
| 29 | + |
| 30 | +with open("README.md", "r") as fh: |
| 31 | + long_description = fh.read() |
| 32 | + |
| 33 | +deps = ['numpy', 'Pillow', 'psutil'] |
| 34 | +if is_raspberrypi(): # drone |
| 35 | + deps.append(['picamera', 'yamspy==0.3.3', 'opencv-python']) |
| 36 | +elif is_coral(): # drone |
| 37 | + deps.append(['yamspy==0.3.3', 'opencv-python']) |
| 38 | +else: # remote |
| 39 | + deps.append(['opencv-contrib-python', 'pysimplegui']) |
| 40 | + |
| 41 | +setup(name='cognifly', |
| 42 | + packages=[package for package in find_packages()], |
| 43 | + version='0.3.3', |
| 44 | + license='MIT', |
| 45 | + description='Control the CogniFly open-source drone from python', |
| 46 | + long_description=long_description, |
| 47 | + long_description_content_type="text/markdown", |
| 48 | + author='Yann Bouteiller', |
| 49 | + url='https://github.com/thecognifly/cognifly-python', |
| 50 | + download_url='https://github.com/thecognifly/cognifly-python/archive/refs/tags/v0.3.3.tar.gz', |
| 51 | + keywords=['cognifly', 'drone', 'remote', 'control'], |
| 52 | + install_requires=deps, |
| 53 | + scripts=["scripts/cognifly-controller", ], |
| 54 | + classifiers=[ |
| 55 | + 'Development Status :: 4 - Beta', |
| 56 | + 'Intended Audience :: Developers', |
| 57 | + 'Intended Audience :: Education', |
| 58 | + 'Intended Audience :: Information Technology', |
| 59 | + 'Intended Audience :: Science/Research', |
| 60 | + 'License :: OSI Approved :: MIT License', |
| 61 | + 'Operating System :: Microsoft :: Windows', |
| 62 | + 'Operating System :: POSIX :: Linux', |
| 63 | + 'Programming Language :: Python', |
| 64 | + 'Framework :: Robot Framework :: Library', |
| 65 | + 'Topic :: Education', |
| 66 | + 'Topic :: Scientific/Engineering :: Artificial Intelligence', |
| 67 | + ], |
| 68 | + package_data={'cognifly': [ |
| 69 | + 'cognifly_remote/sprites/gamepad_off.png', |
| 70 | + 'cognifly_remote/sprites/gamepad_on.png']} |
| 71 | + ) |
0 commit comments