perf: use fast entry points on non-wheel install

This avoids importing `pkg_resources` on startup, which saves around 200
ms.

NOTE: wheel installer uses its own entry points template, which is the same
fastentrypoints.py script provides, so no gain there.
This commit is contained in:
Alexander Schepanovski
2019-09-12 22:33:59 +07:00
parent 69f0de0090
commit 293a50d75c
3 changed files with 129 additions and 0 deletions
+5
View File
@@ -3,6 +3,11 @@ from setuptools.command.build_py import build_py as _build_py
import os
import sys
# Prevents pkg_resources import in entry point script,
# see https://github.com/ninjaaron/fast-entry_points.
# This saves about 200 ms on startup time for non-wheel installs.
import fastentrypoints # noqa: F401
# https://packaging.python.org/guides/single-sourcing-package-version/
pkg_dir = os.path.dirname(__file__)