Skip to content

Commit fb1013d

Browse files
committed
Restore vendored wheel code and add a dry_run property for temporary compatibility.
1 parent eaeab51 commit fb1013d

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Diff for: setuptools/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@ class Command(_Command):
167167
command_consumes_arguments = False
168168
distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution
169169

170+
dry_run = False
171+
"""
172+
For compatibility with vendored bdist_wheel.
173+
https://github.com/pypa/setuptools/pull/4872/files#r1986395142
174+
"""
175+
170176
def __init__(self, dist: Distribution, **kw) -> None:
171177
"""
172178
Construct the command for dist, updating

Diff for: setuptools/_vendor/wheel/bdist_wheel.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,11 @@ def run(self):
440440

441441
if not self.keep_temp:
442442
log.info(f"removing {self.bdist_dir}")
443-
if sys.version_info < (3, 12):
444-
rmtree(self.bdist_dir, onerror=remove_readonly)
445-
else:
446-
rmtree(self.bdist_dir, onexc=remove_readonly_exc)
443+
if not self.dry_run:
444+
if sys.version_info < (3, 12):
445+
rmtree(self.bdist_dir, onerror=remove_readonly)
446+
else:
447+
rmtree(self.bdist_dir, onexc=remove_readonly_exc)
447448

448449
def write_wheelfile(
449450
self, wheelfile_base, generator="bdist_wheel (" + wheel_version + ")"

0 commit comments

Comments
 (0)