diff options
author | shangxdy <shang.xiaodong@zte.com.cn> | 2017-08-31 10:22:48 +0800 |
---|---|---|
committer | shangxdy <shang.xiaodong@zte.com.cn> | 2017-09-06 18:18:46 +0800 |
commit | 87be76e6c8b3024c05fe76a97a5a922486a64bb9 (patch) | |
tree | d0ff8a7cc57c80c1d81a7f3bde08662bfd830186 /setup.py | |
parent | 33c0357fefe6683a58c7c21477f1a411b62f293f (diff) |
Package for funectest
Modify the install script
JIRA: PARSER-125
Change-Id: Ia43687286fb8ac3b18b816aa5e4928ce9a12beec
Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 44 |
1 files changed, 44 insertions, 0 deletions
@@ -1,10 +1,54 @@ +import os import setuptools +from distutils.command.install_data import install_data +from setuptools.command.build_py import build_py +from setuptools.command.install import install + try: import multiprocessing # noqa except ImportError: pass + +class Parser_build_py(build_py): + """Override build_py to call customized build.""" + + def run(self): + print(" === Before nfv parser build === ") + # self.run_command('xxx') + super(Parser_build_py, self).run() + print(" === After nfv parser build === ") + + +class Parser_install(install): + """Override install to call customized install.""" + + def run(self): + print(" === Before nfv parser install === ") + super(Parser_install, self).run(self) + # Custom stuff here + # distutils.command.install actually has some nice helper methods + # and interfaces. I strongly suggest reading the docstrings. + print(" === After nfv parser install === ") + + +class Parser_post_install(install_data): + """Override install_data to call customized install_data.""" + + def run(self): + print(" === Before nfv parser post install data === ") + # Call parent + super(Parser_post_install, self).run(self) + # Execute commands + print(" === After nfv parser post install data ===") + + setuptools.setup( setup_requires=['pbr>=2.0.0'], + cmdclass={ + "build_py": Parser_build_py, + "install_data": Parser_install, + "post_install": Parser_post_install, + }, pbr=True) |