Delay checking size until it's actually used.
[jelmer/dulwich-libgit2.git] / setup.py
1 #!/usr/bin/python
2 # Setup file for bzr-git
3 # Copyright (C) 2008-2009 Jelmer Vernooij <jelmer@samba.org>
4
5 try:
6     from setuptools import setup, Extension
7 except ImportError:
8     from distutils.core import setup, Extension
9
10 dulwich_version_string = '0.5.0'
11
12 include_dirs = []
13 # Windows MSVC support
14 import sys
15 if sys.platform == 'win32':
16     include_dirs.append('dulwich')
17
18 ext_modules = [
19     Extension('dulwich._objects', ['dulwich/_objects.c'],
20               include_dirs=include_dirs),
21     Extension('dulwich._pack', ['dulwich/_pack.c'],
22               include_dirs=include_dirs),
23     ]
24
25 try:
26     from setuptools import Feature
27 except ImportError:
28     speedups = None
29     mandatory_ext_modules = ext_modules
30 else:
31     mandatory_ext_modules = []
32     speedups = Feature(
33         "optional C speed-enhancements",
34         standard = True,
35         ext_modules=ext_modules,
36     )
37
38
39 setup(name='dulwich',
40       description='Pure-Python Git Library',
41       keywords='git',
42       version=dulwich_version_string,
43       url='http://samba.org/~jelmer/dulwich',
44       download_url='http://samba.org/~jelmer/dulwich/dulwich-%s.tar.gz' % dulwich_version_string,
45       license='GPLv2 or later',
46       author='Jelmer Vernooij',
47       author_email='jelmer@samba.org',
48       long_description="""
49       Simple Pure-Python implementation of the Git file formats and
50       protocols. Dulwich is the place where Mr. and Mrs. Git live
51       in one of the Monty Python sketches.
52       """,
53       packages=['dulwich', 'dulwich.tests'],
54       scripts=['bin/dulwich', 'bin/dul-daemon', 'bin/dul-web'],
55       features = {'speedups': speedups},
56       ext_modules = mandatory_ext_modules,
57       )