diff options
author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-03-06 21:12:19 +0000 |
---|---|---|
committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-03-07 21:48:38 +0000 |
commit | 18347fb2cbe534b6d82e0b6972a1d1c7db593892 (patch) | |
tree | 6941fd0970da1d7ca76b7e219bd565671cf11baf | |
parent | 14c420b67728479d1a2826155210667b5c20c16b (diff) | |
download | python-setuptools-git-18347fb2cbe534b6d82e0b6972a1d1c7db593892.tar.gz |
Use new warnings in setuptools/installer.py
-rw-r--r-- | setuptools/installer.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/setuptools/installer.py b/setuptools/installer.py index 137f35ac..44ed0da2 100644 --- a/setuptools/installer.py +++ b/setuptools/installer.py @@ -3,7 +3,6 @@ import os import subprocess import sys import tempfile -import warnings from distutils import log from distutils.errors import DistutilsError from functools import partial @@ -25,7 +24,7 @@ def fetch_build_egg(dist, req): """Fetch an egg needed for building. Use pip/wheel to fetch/build a wheel.""" - _DeprecatedInstaller.warn(stacklevel=2) + _DeprecatedInstaller.emit() _warn_wheel_not_available(dist) return _fetch_build_egg_no_warn(dist, req) @@ -33,7 +32,7 @@ def fetch_build_egg(dist, req): def _fetch_build_eggs(dist, requires): import pkg_resources # Delay import to avoid unnecessary side-effects - _DeprecatedInstaller.warn(stacklevel=3) + _DeprecatedInstaller.emit(stacklevel=3) _warn_wheel_not_available(dist) resolved_dists = pkg_resources.working_set.resolve( @@ -131,12 +130,9 @@ def _warn_wheel_not_available(dist): class _DeprecatedInstaller(SetuptoolsDeprecationWarning): - @classmethod - def warn(cls, stacklevel=1): - warnings.warn( - "setuptools.installer and fetch_build_eggs are deprecated. " - "Requirements should be satisfied by a PEP 517 installer. " - "If you are using pip, you can try `pip install --use-pep517`.", - cls, - stacklevel=stacklevel+1 - ) + _SUMMARY = "setuptools.installer and fetch_build_eggs are deprecated." + _DETAILS = """ + Requirements should be satisfied by a PEP 517 installer. + If you are using pip, you can try `pip install --use-pep517`. + """ + # _DUE_DATE not decided yet |