aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTommi Virtanen <tv@eagain.net>2007-09-03 14:06:51 -0700
committerTommi Virtanen <tv@eagain.net>2007-09-03 14:06:51 -0700
commite492d76c29f41c557042a09b4886ab4df67d4c0d (patch)
tree72aab628542fe142c4e6888a1f3c3e0b9f9b98de
parentMake error messages harder to confuse with strerror(3). (diff)
downloadgitosis-dakkar-e492d76c29f41c557042a09b4886ab4df67d4c0d.tar.gz
gitosis-dakkar-e492d76c29f41c557042a09b4886ab4df67d4c0d.tar.bz2
gitosis-dakkar-e492d76c29f41c557042a09b4886ab4df67d4c0d.zip
Make setuptools include templates in the egg.
-rwxr-xr-xsetup.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index 3b2dd97..50d1a6d 100755
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,21 @@
#!/usr/bin/python
from setuptools import setup, find_packages
+import os
+
+def _subdir_contents(path):
+ for toplevel in os.listdir(path):
+ toplevel_path = os.path.join(path, toplevel)
+ if not os.path.isdir(toplevel_path):
+ continue
+ for dirpath, dirnames, filenames in os.walk(toplevel_path):
+ for filename in filenames:
+ full_path = os.path.join(dirpath, filename)
+ if not full_path.startswith(path+'/'):
+ raise RuntimeError()
+ yield full_path[len(path)+1:]
+def subdir_contents(path):
+ return list(_subdir_contents(path))
+
setup(
name = "gitosis",
version = "0.1",
@@ -21,4 +37,11 @@ setup(
'gitosis-init = gitosis.init:main',
],
},
+
+ package_data = {
+ # this seems to be the only way to convince setuptools
+ # to include things recursively
+ 'gitosis.templates': subdir_contents('gitosis/templates'),
+ },
)
+