setup.py 2.1 KB

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