setup.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. from setuptools import find_packages
  2. from setuptools import setup
  3. import shlex
  4. import subprocess
  5. import sys
  6. PY3 = sys.version_info[0] == 3
  7. PY2 = sys.version_info[0] == 2
  8. assert PY3 or PY2
  9. version = '2.11.0'
  10. install_requires = [
  11. 'matplotlib',
  12. 'numpy',
  13. 'Pillow>=2.8.0',
  14. 'PyYAML',
  15. 'qtpy',
  16. ]
  17. try:
  18. import PyQt5 # NOQA
  19. PYQT_VERSION = 5
  20. except ImportError:
  21. try:
  22. import PyQt4 # NOQA
  23. PYQT_VERSION = 4
  24. except ImportError:
  25. if PY2:
  26. sys.stderr.write(
  27. 'Please install PyQt4 or PyQt5 for Python2.\n'
  28. 'Note that PyQt5 can be installed via pip for Python3.')
  29. sys.exit(1)
  30. assert PY3
  31. # PyQt5 can be installed via pip for Python3
  32. install_requires.append('pyqt5')
  33. PYQT_VERSION = 5
  34. if sys.argv[1] == 'release':
  35. commands = [
  36. 'git tag v{:s}'.format(version),
  37. 'git push origin master --tag',
  38. 'python setup.py sdist',
  39. 'twine upload dist/labelme-{:s}.tar.gz'.format(version),
  40. ]
  41. sys.exit(sum(subprocess.call(shlex.split(cmd)) for cmd in commands))
  42. setup(
  43. name='labelme',
  44. version=version,
  45. packages=find_packages(),
  46. description='Image Polygonal Annotation with Python.',
  47. long_description=open('README.md').read(),
  48. long_description_content_type='text/markdown',
  49. author='Kentaro Wada',
  50. author_email='www.kentaro.wada@gmail.com',
  51. url='https://github.com/wkentaro/labelme',
  52. install_requires=install_requires,
  53. license='GPLv3',
  54. keywords='Image Annotation, Machine Learning',
  55. classifiers=[
  56. 'Development Status :: 5 - Production/Stable',
  57. 'Intended Audience :: Developers',
  58. 'License :: OSI Approved :: MIT License',
  59. 'Operating System :: POSIX',
  60. 'Topic :: Internet :: WWW/HTTP',
  61. ],
  62. package_data={'labelme': ['icons/*']},
  63. entry_points={
  64. 'console_scripts': [
  65. 'labelme=labelme.app:main',
  66. 'labelme_draw_json=labelme.cli.draw_json:main',
  67. 'labelme_json_to_dataset=labelme.cli.json_to_dataset:main',
  68. 'labelme_on_docker=labelme.cli.on_docker:main',
  69. ],
  70. },
  71. )