1 from ez_setup import use_setuptools
3 from setuptools import setup, find_packages
4 from distutils.command.build_py import build_py as _build_py
5 from setuptools.command.sdist import sdist as _sdist
9 v = open(path.join(path.dirname(__file__), 'VERSION'))
10 VERSION = v.readline().strip()
13 class build_py(_build_py):
15 init = path.join(self.build_lib, 'git', '__init__.py')
20 self.byte_compile([init])
23 def make_release_tree (self, base_dir, files):
24 _sdist.make_release_tree(self, base_dir, files)
25 orig = path.join('lib', 'git', '__init__.py')
26 assert path.exists(orig)
27 dest = path.join(base_dir, orig)
28 if hasattr(os, 'link') and path.exists(dest):
30 self.copy_file(orig, dest)
33 def _stamp_version(filename):
34 found, out = False, []
35 f = open(filename, 'r')
37 if '__version__ =' in line:
38 line = line.replace("'git'", "'%s'" % VERSION)
44 f = open(filename, 'w')
49 setup(name = "GitPython",
50 cmdclass={'build_py': build_py, 'sdist': sdist},
52 description = "Python Git Library",
53 author = "Michael Trier",
54 author_email = "mtrier@gmail.com",
55 url = "http://gitorious.org/projects/git-python/",
56 packages = find_packages('lib'),
57 package_dir = {'':'lib'},
58 license = "BSD License",
59 long_description = """\
60 GitPython is a python library used to interact with Git repositories.
62 GitPython provides object model access to your git repository. Once you have
63 created a repository object, you can traverse it to find parent commit(s),
66 GitPython is a port of the grit library in Ruby created by
67 Tom Preston-Werner and Chris Wanstrath.
70 "Development Status :: 3 - Alpha",
71 "Intended Audience :: Developers",
72 "License :: OSI Approved :: BSD License",
73 "Programming Language :: Python",
74 "Topic :: Software Development :: Libraries :: Python Modules",