forked from wkentaro/labelme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
104 lines (90 loc) · 2.72 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import imp
import os.path
from setuptools import find_packages
from setuptools import setup
import shlex
import subprocess
import sys
PY3 = sys.version_info[0] == 3
PY2 = sys.version_info[0] == 2
assert PY3 or PY2
here = os.path.abspath(os.path.dirname(__file__))
version = imp.load_source(
'_version', os.path.join(here, 'labelme', '_version.py')).__version__
del here
install_requires = [
'matplotlib',
'numpy',
'Pillow>=2.8.0',
'PyYAML',
'qtpy',
]
# Find python binding for qt with priority:
# PyQt5 -> PySide2 -> PyQt4,
# and PyQt5 is automatically installed on Python3.
QT_BINDING = None
try:
import PyQt5 # NOQA
QT_BINDING = 'pyqt5'
except ImportError:
pass
if QT_BINDING is None:
try:
import PySide2 # NOQA
QT_BINDING = 'pyside2'
except ImportError:
pass
if QT_BINDING is None:
try:
import PyQt4 # NOQA
QT_BINDING = 'pyqt4'
except ImportError:
if PY2:
sys.stderr.write(
'Please install PyQt5, PySide2 or PyQt4 for Python2.\n'
'Note that PyQt5 can be installed via pip for Python3.')
sys.exit(1)
assert PY3
# PyQt5 can be installed via pip for Python3
install_requires.append('pyqt5')
QT_BINDING = 'pyqt5'
del QT_BINDING
if sys.argv[1] == 'release':
commands = [
'git tag v{:s}'.format(version),
'git push origin master --tag',
'python setup.py sdist',
'twine upload dist/labelme-{:s}.tar.gz'.format(version),
]
sys.exit(sum(subprocess.call(shlex.split(cmd)) for cmd in commands))
setup(
name='labelme',
version=version,
packages=find_packages(),
description='Image Polygonal Annotation with Python.',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
author='Kentaro Wada',
author_email='[email protected]',
url='https://github.com/wkentaro/labelme',
install_requires=install_requires,
license='GPLv3',
keywords='Image Annotation, Machine Learning',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX',
'Topic :: Internet :: WWW/HTTP',
],
package_data={'labelme': ['icons/*', 'config/*.yaml']},
entry_points={
'console_scripts': [
'labelme=labelme.app:main',
'labelme_draw_json=labelme.cli.draw_json:main',
'labelme_draw_label_png=labelme.cli.draw_label_png:main',
'labelme_json_to_dataset=labelme.cli.json_to_dataset:main',
'labelme_on_docker=labelme.cli.on_docker:main',
],
},
)