summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index 5cca4c8..47cca43 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=W0404,W0622,W0704,W0613
-# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
@@ -105,8 +105,7 @@ except ImportError:
'''
class MyInstallLib(install_lib.install_lib):
- """extend install_lib command to handle package __init__.py and
- include_dirs variable if necessary
+ """extend install_lib command to handle package __init__.py if necessary
"""
def run(self):
"""overridden from install_lib class"""
@@ -119,17 +118,27 @@ class MyInstallLib(install_lib.install_lib):
stream = open(product_init, 'w')
stream.write(EMPTY_FILE)
stream.close()
+
+
+class MyBuildPy(build_py):
+ """extend build_by command to handle include_dirs variable if necessary
+ """
+ def run(self):
+ """overridden from install_lib class"""
+ build_py.run(self)
# manually install included directories if any
if include_dirs:
if subpackage_of:
base = join(subpackage_of, modname)
else:
base = modname
+ basedir = os.path.join(self.build_lib, base)
for directory in include_dirs:
- dest = join(self.install_dir, base, directory)
+ dest = join(basedir, directory)
shutil.rmtree(dest, ignore_errors=True)
shutil.copytree(directory, dest)
+
def install(**kwargs):
"""setup entry point"""
if USE_SETUPTOOLS:
@@ -164,7 +173,7 @@ def install(**kwargs):
data_files = data_files,
ext_modules = ext_modules,
cmdclass = {'install_lib': MyInstallLib,
- 'build_py': build_py},
+ 'build_py': MyBuildPy},
**kwargs
)