From 922e7039dc04f7b403bf66c8321d89c637c61e87 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 10 Apr 2018 13:45:44 +0200 Subject: [PATCH] Shield setup module from accidental setup exec This might happen when third-parties like analizers import this module for testing purposes. --- setup.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 08b0f253b1..31bfe3137a 100644 --- a/setup.py +++ b/setup.py @@ -162,7 +162,8 @@ for extra_requirements_filename in os.listdir(extra_requirements_dir): with open('README.rst', 'r') as readme_file: longdesc = readme_file.read() -setup( + +setup_params = dict( # Use the distutils SDist so that symlinks are not expanded # Use a custom Build for the same reason cmdclass={ @@ -240,3 +241,12 @@ setup( # Installing as zip files would break due to references to __file__ zip_safe=False ) + + +def main(): + """Invoke installation process using setuptools.""" + setup(**setup_params) + + +if __name__ == '__main__': + main()