Local Docs Builds
[parser.git] / setup.py
1 import os
2 import setuptools
3
4 from distutils.command.install_data import install_data
5 from setuptools.command.build_py import build_py
6 from setuptools.command.install import install
7
8 try:
9     import multiprocessing  # noqa
10 except ImportError:
11     pass
12
13
14 class Parser_build_py(build_py):
15     """Override build_py to call customized build."""
16
17     def run(self):
18         print(" ===  Before nfv parser build === ")
19         # self.run_command('xxx')
20         super(Parser_build_py, self).run()
21         print(" ===  After nfv parser build === ")
22
23
24 class Parser_install(install):
25     """Override install to call customized install."""
26
27     def run(self):
28         print(" ===  Before nfv parser install === ")
29         super(Parser_install, self).run(self)
30         # Custom stuff here
31         # distutils.command.install actually has some nice helper methods
32         # and interfaces. I strongly suggest reading the docstrings.
33         print(" === After nfv parser install === ")
34
35
36 class Parser_post_install(install_data):
37     """Override install_data to call customized install_data."""
38
39     def run(self):
40         print(" === Before nfv parser post install data === ")
41         # Call parent
42         super(Parser_post_install, self).run(self)
43         # Execute commands
44         print(" === After nfv parser post install data ===")
45
46
47 setuptools.setup(
48     setup_requires=['pbr>=2.0.0'],
49     cmdclass={
50         "build_py": Parser_build_py,
51         "install_data": Parser_install,
52         "post_install": Parser_post_install,
53     },
54     pbr=True)