2 # Setup file for dulwich
3 # Copyright (C) 2008-2011 Jelmer Vernooij <jelmer@samba.org>
6 from setuptools import setup, Extension
8 from distutils.core import setup, Extension
9 from distutils.core import Distribution
11 dulwich_version_string = '0.9.8'
14 # Windows MSVC support
17 if sys.platform == 'win32':
18 include_dirs.append('dulwich')
21 class DulwichDistribution(Distribution):
27 def has_ext_modules(self):
28 return not self.pure and not '__pypy__' in sys.modules
30 global_options = Distribution.global_options + [
31 ('pure', None, "use pure Python code instead of C "
32 "extensions (slower on CPython)")]
36 if sys.platform == 'darwin' and os.path.exists('/usr/bin/xcodebuild'):
37 # XCode 4.0 dropped support for ppc architecture, which is hardcoded in
41 ['/usr/bin/xcodebuild', '-version'], stdout=subprocess.PIPE,
42 stderr=subprocess.PIPE, env={})
43 out, err = p.communicate()
44 for l in out.splitlines():
46 # Also parse only first digit, because 3.2.1 can't be parsed nicely
47 if l.startswith('Xcode') and int(l.split()[1].split('.')[0]) >= 4:
48 os.environ['ARCHFLAGS'] = ''
52 description='Python Git Library',
54 version=dulwich_version_string,
55 url='https://samba.org/~jelmer/dulwich',
56 license='GPLv2 or later',
57 author='Jelmer Vernooij',
58 author_email='jelmer@samba.org',
60 Python implementation of the Git file formats and protocols,
61 without the need to have git installed.
63 All functionality is available in pure Python. Optional
64 C extensions can be built for improved performance.
66 The project is named after the part of London that Mr. and Mrs. Git live in
67 in the particular Monty Python sketch.
69 packages=['dulwich', 'dulwich.tests', 'dulwich.tests.compat', 'dulwich.contrib'],
70 scripts=['bin/dulwich', 'bin/dul-receive-pack', 'bin/dul-upload-pack'],
72 'Development Status :: 4 - Beta',
73 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)',
74 'Programming Language :: Python :: 2.7',
75 'Operating System :: POSIX',
76 'Topic :: Software Development :: Version Control',
79 Extension('dulwich._objects', ['dulwich/_objects.c'],
80 include_dirs=include_dirs),
81 Extension('dulwich._pack', ['dulwich/_pack.c'],
82 include_dirs=include_dirs),
83 Extension('dulwich._diff_tree', ['dulwich/_diff_tree.c'],
84 include_dirs=include_dirs),
86 test_suite='dulwich.tests.test_suite',
87 tests_require=['fastimport', 'mock', 'gevent', 'geventhttpclient'],
88 distclass=DulwichDistribution,
89 include_package_data=True,
91 convert_2to3_doctests=['../docs/*', '../docs/tutorial/*', ],