Permalink
Browse files

Merge pull request #3 from fin/master

enable pip install from git repository
  • Loading branch information...
Timmy O'Mahony
Timmy O'Mahony committed Jun 27, 2012
2 parents 489999f + f90d400 commit 0942a29e0f5ca6f8c0589bb735aa8e6ac51df71d
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 0942a29

Please sign in to comment.