Permalink
Browse files

enable pip install

  • Loading branch information...
fin committed Jun 14, 2012
1 parent 489999f commit f90d4000de93bcf588d49a4d7fad06e4f37687c7
Showing with 19 additions and 9 deletions.
  1. +19 −9 setup.py
View
@@ -4,19 +4,29 @@
from subprocess import check_call
from distutils.command.build import build
from distutils.dir_util import copy_tree, remove_tree
+from setuptools.command.develop import develop
+
+def get_submodules_and_fix_paths():
+ if path.exists('.git'):
+ check_call(['git', 'submodule', 'init'])
+ check_call(['git', 'submodule', 'update'])
+ # Move contents of pagedown and remove .git
+ dst = "pagedown/static/pagedown/"
+ src = "pagedown/static/pagedown/pagedown/"
+ copy_tree(src, dst)
+ remove_tree(src)
class build_with_submodules(build):
def run(self):
- if path.exists('.git'):
- check_call(['git', 'submodule', 'init'])
- check_call(['git', 'submodule', 'update'])
- # Move contents of pagedown and remove .git
- dst = "pagedown/static/pagedown/"
- src = "pagedown/static/pagedown/pagedown/"
- copy_tree(src, dst)
- remove_tree(src)
+ get_submodules_and_fix_paths()
build.run(self)
+class develop_with_submodules(develop):
+ def run(self):
+ get_submodules_and_fix_paths()
+ develop.run(self)
+
+
setup(
name = "django-pagedown",
version = "0.0.1",
@@ -31,5 +41,5 @@ def run(self):
"Django >= 1.3",
],
license='LICENSE.txt',
- cmdclass={"build": build_with_submodules},
+ cmdclass={"build": build_with_submodules, "develop": develop_with_submodules},
)

0 comments on commit f90d400

Please sign in to comment.