mirror of https://github.com/pypa/pip
add support for returning setuptools version for bigquery statistics (#4209)
* add support for returning setuptools version for bigquery statistics * don't send the data if None * add changelog entry
This commit is contained in:
parent
299da9762c
commit
476d297ff6
|
@ -0,0 +1 @@
|
|||
Add setuptools version to the statistics sent to BigQuery.
|
|
@ -28,7 +28,8 @@ from pip.exceptions import InstallationError, HashMismatch
|
|||
from pip.models import PyPI
|
||||
from pip.utils import (splitext, rmtree, format_size, display_path,
|
||||
backup_dir, ask_path_exists, unpack_file,
|
||||
ARCHIVE_EXTENSIONS, consume, call_subprocess)
|
||||
ARCHIVE_EXTENSIONS, consume, call_subprocess,
|
||||
get_installed_version)
|
||||
from pip.utils.encoding import auto_decode
|
||||
from pip.utils.filesystem import check_path_owner
|
||||
from pip.utils.logging import indent_log
|
||||
|
@ -119,6 +120,10 @@ def user_agent():
|
|||
if HAS_TLS:
|
||||
data["openssl_version"] = ssl.OPENSSL_VERSION
|
||||
|
||||
setuptools_version = get_installed_version("setuptools")
|
||||
if setuptools_version is not None:
|
||||
data["setuptools_version"] = setuptools_version
|
||||
|
||||
return "{data[installer][name]}/{data[installer][version]} {json}".format(
|
||||
data=data,
|
||||
json=json.dumps(data, separators=(",", ":"), sort_keys=True),
|
||||
|
|
Loading…
Reference in New Issue