Make setuptools include templates in the egg.
This commit is contained in:
parent
3c2963b777
commit
e492d76c29
1 changed files with 23 additions and 0 deletions
23
setup.py
23
setup.py
|
@ -1,5 +1,21 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
from setuptools import setup, find_packages
|
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(
|
setup(
|
||||||
name = "gitosis",
|
name = "gitosis",
|
||||||
version = "0.1",
|
version = "0.1",
|
||||||
|
@ -21,4 +37,11 @@ setup(
|
||||||
'gitosis-init = gitosis.init:main',
|
'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'),
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue