setup.py 1.4 KB

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