Skip to content

Commit

Permalink
avoid using pkg_resources for faster command execution (sonic-net#426)
Browse files Browse the repository at this point in the history
Signed-off-by: Wataru Ishida <ishida@nel-america.com>
  • Loading branch information
ishidawataru authored and jleveque committed Jan 11, 2019
1 parent 220e269 commit da3934e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit da3934e

Please sign in to comment.