setup.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/usr/bin/python
  2. # Setup file for dulwich
  3. # Copyright (C) 2008-2010 Jelmer Vernooij <jelmer@samba.org>
  4. try:
  5. from setuptools import setup, Extension
  6. except ImportError:
  7. from distutils.core import setup, Extension
  8. from distutils.core import Distribution
  9. dulwich_version_string = '0.7.0'
  10. include_dirs = []
  11. # Windows MSVC support
  12. import sys
  13. if sys.platform == 'win32':
  14. include_dirs.append('dulwich')
  15. class DulwichDistribution(Distribution):
  16. def is_pure(self):
  17. if self.pure:
  18. return True
  19. def has_ext_modules(self):
  20. return not self.pure
  21. global_options = Distribution.global_options + [
  22. ('pure', None,
  23. "use pure (slower) Python code instead of C extensions")]
  24. pure = False
  25. setup(name='dulwich',
  26. description='Pure-Python Git Library',
  27. keywords='git',
  28. version=dulwich_version_string,
  29. url='http://samba.org/~jelmer/dulwich',
  30. download_url='http://samba.org/~jelmer/dulwich/dulwich-%s.tar.gz' % dulwich_version_string,
  31. license='GPLv2 or later',
  32. author='Jelmer Vernooij',
  33. author_email='jelmer@samba.org',
  34. long_description="""
  35. Simple Pure-Python implementation of the Git file formats and
  36. protocols. Dulwich is the place where Mr. and Mrs. Git live
  37. in one of the Monty Python sketches.
  38. """,
  39. packages=['dulwich', 'dulwich.tests'],
  40. scripts=['bin/dulwich', 'bin/dul-daemon', 'bin/dul-web'],
  41. ext_modules = [
  42. Extension('dulwich._objects', ['dulwich/_objects.c'],
  43. include_dirs=include_dirs),
  44. Extension('dulwich._pack', ['dulwich/_pack.c'],
  45. include_dirs=include_dirs),
  46. ],
  47. distclass=DulwichDistribution,
  48. )