|
29 | 29 |
|
30 | 30 | from .. import Command, _normalization, _path, _shutil, errors, namespaces |
31 | 31 | from .._path import StrPath |
32 | | -from ..compat import py312 |
| 32 | +from ..compat import py310, py312 |
33 | 33 | from ..discovery import find_package_path |
34 | 34 | from ..dist import Distribution |
35 | | -from ..warnings import InformationOnly, SetuptoolsDeprecationWarning, SetuptoolsWarning |
| 35 | +from ..warnings import InformationOnly, SetuptoolsDeprecationWarning |
36 | 36 | from .build import build as build_cls |
37 | 37 | from .build_py import build_py as build_py_cls |
38 | 38 | from .dist_info import dist_info as dist_info_cls |
@@ -137,10 +137,14 @@ def run(self) -> None: |
137 | 137 | bdist_wheel.write_wheelfile(self.dist_info_dir) |
138 | 138 |
|
139 | 139 | self._create_wheel_file(bdist_wheel) |
140 | | - except Exception: |
141 | | - traceback.print_exc() |
| 140 | + except Exception as ex: |
142 | 141 | project = self.distribution.name or self.distribution.get_name() |
143 | | - _DebuggingTips.emit(project=project) |
| 142 | + py310.add_note( |
| 143 | + ex, |
| 144 | + f"An error occurred when building editable wheel for {project}.\n" |
| 145 | + "See debugging tips in: " |
| 146 | + "https://setuptools.pypa.io/en/latest/userguide/development_mode.html#debugging-tips", |
| 147 | + ) |
144 | 148 | raise |
145 | 149 |
|
146 | 150 | def _ensure_dist_info(self): |
@@ -902,29 +906,3 @@ def _finder_template( |
902 | 906 |
|
903 | 907 | class LinksNotSupported(errors.FileError): |
904 | 908 | """File system does not seem to support either symlinks or hard links.""" |
905 | | - |
906 | | - |
907 | | -class _DebuggingTips(SetuptoolsWarning): |
908 | | - _SUMMARY = "Problem in editable installation." |
909 | | - _DETAILS = """ |
910 | | - An error happened while installing `{project}` in editable mode. |
911 | | -
|
912 | | - The following steps are recommended to help debug this problem: |
913 | | -
|
914 | | - - Try to install the project normally, without using the editable mode. |
915 | | - Does the error still persist? |
916 | | - (If it does, try fixing the problem before attempting the editable mode). |
917 | | - - If you are using binary extensions, make sure you have all OS-level |
918 | | - dependencies installed (e.g. compilers, toolchains, binary libraries, ...). |
919 | | - - Try the latest version of setuptools (maybe the error was already fixed). |
920 | | - - If you (or your project dependencies) are using any setuptools extension |
921 | | - or customization, make sure they support the editable mode. |
922 | | -
|
923 | | - After following the steps above, if the problem still persists and |
924 | | - you think this is related to how setuptools handles editable installations, |
925 | | - please submit a reproducible example |
926 | | - (see https://stackoverflow.com/help/minimal-reproducible-example) to: |
927 | | -
|
928 | | - https://github.com/pypa/setuptools/issues |
929 | | - """ |
930 | | - _SEE_DOCS = "userguide/development_mode.html" |
0 commit comments