diff options
author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-02-13 18:06:53 +0000 |
---|---|---|
committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-02-13 18:10:53 +0000 |
commit | 23abfb848a1f618b190a94cb8304f0e72bc84499 (patch) | |
tree | e680c520d5913a740b411e63de8237f00e649553 /setuptools/command | |
parent | 8abf6dca26e00557bb4d32e25aaed27d1d00e3ef (diff) | |
download | python-setuptools-git-23abfb848a1f618b190a94cb8304f0e72bc84499.tar.gz |
Use warning in editable since pip hides PEP 678 notes
Diffstat (limited to 'setuptools/command')
-rw-r--r-- | setuptools/command/editable_wheel.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/setuptools/command/editable_wheel.py b/setuptools/command/editable_wheel.py index 338a8a8b..86a272ac 100644 --- a/setuptools/command/editable_wheel.py +++ b/setuptools/command/editable_wheel.py @@ -138,10 +138,10 @@ class editable_wheel(Command): bdist_wheel.write_wheelfile(self.dist_info_dir) self._create_wheel_file(bdist_wheel) - except Exception as ex: + except Exception: traceback.print_exc() project = self.distribution.name or self.distribution.get_name() - _DebuggingInfo.add_help(ex, project) + _DebuggingTips.warn(project) raise def _ensure_dist_info(self): @@ -835,9 +835,9 @@ class LinksNotSupported(errors.FileError): """File system does not seem to support either symlinks or hard links.""" -class _DebuggingInfo(InformationOnly): +class _DebuggingTips(InformationOnly): @classmethod - def add_help(cls, ex: Exception, project: str): + def warn(cls, project: str): msg = f"""An error happened while installing {project!r} in editable mode. ************************************************************************ @@ -863,7 +863,5 @@ class _DebuggingInfo(InformationOnly): https://setuptools.pypa.io/en/latest/userguide/development_mode.html ************************************************************************ """ - if hasattr(ex, "add_note"): - ex.add_note(msg) - else: # PEP 678 fallback - warnings.warn(msg, cls, stacklevel=3) + # We cannot use `add_notes` since pip hides PEP 678 notes + warnings.warn(msg, cls, stacklevel=2) |