|
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,13 +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: |
| 140 | + except Exception as ex: |
141 | 141 | project = self.distribution.name or self.distribution.get_name()
|
142 |
| - if os.environ.get('SETUPTOOLS_INTERNAL_DEBUG'): |
143 |
| - traceback.print_exc() |
144 |
| - _DebuggingTips.emit(project=project) |
145 |
| - else: |
146 |
| - print("An error occurred building editable wheel for", 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 | + ) |
147 | 148 | raise
|
148 | 149 |
|
149 | 150 | def _ensure_dist_info(self):
|
@@ -905,29 +906,3 @@ def _finder_template(
|
905 | 906 |
|
906 | 907 | class LinksNotSupported(errors.FileError):
|
907 | 908 | """File system does not seem to support either symlinks or hard links."""
|
908 |
| - |
909 |
| - |
910 |
| -class _DebuggingTips(SetuptoolsWarning): |
911 |
| - _SUMMARY = "Problem in editable installation." |
912 |
| - _DETAILS = """ |
913 |
| - An error happened while installing `{project}` in editable mode. |
914 |
| -
|
915 |
| - The following steps are recommended to help debug this problem: |
916 |
| -
|
917 |
| - - Try to install the project normally, without using the editable mode. |
918 |
| - Does the error still persist? |
919 |
| - (If it does, try fixing the problem before attempting the editable mode). |
920 |
| - - If you are using binary extensions, make sure you have all OS-level |
921 |
| - dependencies installed (e.g. compilers, toolchains, binary libraries, ...). |
922 |
| - - Try the latest version of setuptools (maybe the error was already fixed). |
923 |
| - - If you (or your project dependencies) are using any setuptools extension |
924 |
| - or customization, make sure they support the editable mode. |
925 |
| -
|
926 |
| - After following the steps above, if the problem still persists and |
927 |
| - you think this is related to how setuptools handles editable installations, |
928 |
| - please submit a reproducible example |
929 |
| - (see https://stackoverflow.com/help/minimal-reproducible-example) to: |
930 |
| -
|
931 |
| - https://github.com/pypa/setuptools/issues |
932 |
| - """ |
933 |
| - _SEE_DOCS = "userguide/development_mode.html" |
0 commit comments