setup.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. from distutils.command.build_py import build_py as BuildPyCommand
  2. import os.path as osp
  3. from setuptools import find_packages
  4. from setuptools import setup
  5. import shlex
  6. import subprocess
  7. import sys
  8. version = '1.1.1'
  9. class LabelmeBuildPyCommand(BuildPyCommand):
  10. def run(self):
  11. BuildPyCommand.run(self)
  12. src = 'labelme/resources.qrc'
  13. dst = 'labelme/resources.py'
  14. cmd = 'pyrcc4 -o {1} {0}'.format(src, dst)
  15. print('converting {0} -> {1}'.format(src, dst))
  16. this_dir = osp.dirname(osp.abspath(__file__))
  17. subprocess.check_call(shlex.split(cmd), cwd=this_dir)
  18. try:
  19. import PyQt4
  20. except ImportError:
  21. sys.stderr.write('Please install PyQt4.\n')
  22. sys.exit(1)
  23. setup(
  24. name='labelme',
  25. version=version,
  26. packages=find_packages(),
  27. cmdclass={'build_py': LabelmeBuildPyCommand},
  28. description='Simple Image Annotation Tool.',
  29. long_description=open('README.rst').read(),
  30. author='mpitid',
  31. author_email='mpitid@gmail.com',
  32. url='https://github.com/mpitid/pylabelme',
  33. install_requires=[],
  34. license='MIT',
  35. keywords='Image Annotation, Machine Learning',
  36. classifiers=[
  37. 'Development Status :: 5 - Production/Stable',
  38. 'Intended Audience :: Developers',
  39. 'License :: OSI Approved :: MIT License',
  40. 'Operating System :: POSIX',
  41. 'Topic :: Internet :: WWW/HTTP',
  42. ],
  43. package_data={'labelme': ['icons']},
  44. scripts=['scripts/labelme'],
  45. )