diff options
| author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-06-25 20:05:38 +0100 |
|---|---|---|
| committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-06-25 20:07:27 +0100 |
| commit | a3e8d4da41e651884848f5bb43148c12faa12f2f (patch) | |
| tree | 7b7a1d8f2b6f87363b3b3d0ba6f188d723cb056d /setuptools/command | |
| parent | 16483185a2739d5f613430f2f4ba83883eb6bb96 (diff) | |
| download | python-setuptools-git-a3e8d4da41e651884848f5bb43148c12faa12f2f.tar.gz | |
Add help message to editable install exception
Diffstat (limited to 'setuptools/command')
| -rw-r--r-- | setuptools/command/editable_wheel.py | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/setuptools/command/editable_wheel.py b/setuptools/command/editable_wheel.py index 8a0fb8bc..7a396bbe 100644 --- a/setuptools/command/editable_wheel.py +++ b/setuptools/command/editable_wheel.py @@ -15,8 +15,10 @@ import os import re import shutil import sys +import traceback import warnings from contextlib import suppress +from inspect import cleandoc from itertools import chain from pathlib import Path from tempfile import TemporaryDirectory @@ -88,14 +90,29 @@ class editable_wheel(Command): self.dist_dir = Path(self.dist_dir or os.path.join(self.project_dir, "dist")) def run(self): - self.dist_dir.mkdir(exist_ok=True) - self._ensure_dist_info() + try: + self.dist_dir.mkdir(exist_ok=True) + self._ensure_dist_info() + + # Add missing dist_info files + bdist_wheel = self.reinitialize_command("bdist_wheel") + bdist_wheel.write_wheelfile(self.dist_info_dir) + + self._create_wheel_file(bdist_wheel) + except Exception as ex: + traceback.print_exc() + msg = """ + Support for editable installs via PEP 660 was recently introduced + in `setuptools`. If you are seeing this error, please report to: + + https://github.com/pypa/setuptools/issues - # Add missing dist_info files - bdist_wheel = self.reinitialize_command("bdist_wheel") - bdist_wheel.write_wheelfile(self.dist_info_dir) + Meanwhile you can try the legacy behavior by setting an + environment variable and trying to install again: - self._create_wheel_file(bdist_wheel) + SETUPTOOLS_ENABLE_FEATURES="legacy-editable" + """ + raise errors.InternalError(cleandoc(msg)) from ex def _ensure_dist_info(self): if self.dist_info_dir is None: |
