setup.py 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/usr/bin/env python
  2. from __future__ import with_statement
  3. from distutils.core import setup
  4. import os
  5. # Create symlink so that to use 'scripts' w/o '.py'
  6. link_name = 'cdiff'
  7. if os.path.exists(link_name):
  8. os.unlink(link_name)
  9. os.symlink('src/cdiff.py', link_name)
  10. # This awfulness is all in aid of grabbing the version number out
  11. # of the source code, rather than having to repeat it here. Basically,
  12. # we parse out firt line starts with "__version__" and execute it
  13. #
  14. with open('cdiff') as script:
  15. for line in script:
  16. if line.startswith('__version__ = '):
  17. exec(line)
  18. break
  19. with open('README.rst') as doc:
  20. long_description = doc.read()
  21. with open('CHANGES') as changes:
  22. long_description += changes.read()
  23. setup(
  24. name = 'cdiff',
  25. version = __version__,
  26. author = 'Matthew Wang',
  27. author_email = 'mattwyl(@)gmail(.)com',
  28. license = 'BSD-3',
  29. description = ('Term based tool to view colored, incremental diff in '
  30. 'unified format or side by side with auto pager'),
  31. long_description = long_description,
  32. keywords = 'colored incremental side-by-side diff',
  33. url = 'https://github.com/ymattw/cdiff',
  34. classifiers = [
  35. 'Development Status :: 4 - Beta',
  36. 'Topic :: Utilities',
  37. 'License :: OSI Approved :: BSD License',
  38. 'Environment :: Console',
  39. 'Intended Audience :: Developers',
  40. 'Operating System :: MacOS :: MacOS X',
  41. 'Operating System :: POSIX',
  42. 'Operating System :: Unix',
  43. 'Programming Language :: Python',
  44. ],
  45. package_dir = {'': 'src'},
  46. packages = [''],
  47. py_modules = ['cdiff'],
  48. scripts = [link_name],
  49. )