mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-10 14:54:17 +00:00
Merge branch 'startup_perf' into 'master'
Defer setuptools import to save ~60ms on startup See merge request pycqa/flake8!250
This commit is contained in:
commit
e2ad8aa186
1 changed files with 3 additions and 2 deletions
|
|
@ -4,8 +4,6 @@ from __future__ import print_function
|
||||||
import json
|
import json
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
import setuptools
|
|
||||||
|
|
||||||
|
|
||||||
def print_information(option, option_string, value, parser,
|
def print_information(option, option_string, value, parser,
|
||||||
option_manager=None):
|
option_manager=None):
|
||||||
|
|
@ -65,4 +63,7 @@ def plugins_from(option_manager):
|
||||||
|
|
||||||
def dependencies():
|
def dependencies():
|
||||||
"""Generate the list of dependencies we care about."""
|
"""Generate the list of dependencies we care about."""
|
||||||
|
# defer this expensive import, not used outside --bug-report
|
||||||
|
import setuptools
|
||||||
|
|
||||||
return [{'dependency': 'setuptools', 'version': setuptools.__version__}]
|
return [{'dependency': 'setuptools', 'version': setuptools.__version__}]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue