mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-13 15:28:27 +01:00
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:
@@ -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__)
|
||||
|
||||
Reference in New Issue
Block a user