From e6c2c7a96d013788ccbbbcceab9e8aac4384996f Mon Sep 17 00:00:00 2001 From: Wataru Ishida Date: Fri, 4 Jan 2019 18:27:32 -0800 Subject: [PATCH] avoid using pkg_resources for faster command execution Signed-off-by: Wataru Ishida --- setup.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/setup.py b/setup.py index f1bd65e3d2..cdc7112903 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,19 @@ +# https://github.com/ninjaaron/fast-entry_points +# workaround for slow 'pkg_resources' import +# +# NOTE: this only has effect on console_scripts and no speed-up for commands +# under scripts/. Consider stop using scripts and use console_scripts instead +# +# https://stackoverflow.com/questions/18787036/difference-between-entry-points-console-scripts-and-scripts-in-setup-py +try: + import fastentrypoints +except ImportError: + from setuptools.command import easy_install + import pkg_resources + easy_install.main(['fastentrypoints']) + pkg_resources.require('fastentrypoints') + import fastentrypoints + import glob from setuptools import setup import unittest