Skip to content

Commit df0ae62

Browse files
committed
Reintroduce the --wheel CLI option, even though it has no effect on Python >= 3.8
1 parent e9b6ba7 commit df0ae62

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

src/virtualenv/seed/embed/base_embed.py

+16-12
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,23 @@ def __init__(self, options) -> None:
2020

2121
self.pip_version = options.pip
2222
self.setuptools_version = options.setuptools
23-
if hasattr(options, "wheel"):
24-
# Python 3.8
25-
self.wheel_version = options.wheel
26-
self.no_wheel = options.no_wheel
27-
elif options.no_wheel:
23+
self.wheel_version = options.wheel
24+
25+
self.no_pip = options.no_pip
26+
self.no_setuptools = options.no_setuptools
27+
self.no_wheel = options.no_wheel
28+
29+
if options.no_wheel or options.wheel: # and interpreter.version_info[:2] >= (3, 9)
2830
warn(
29-
"The --no-wheel option is deprecated. "
30-
"It has no effect for Python >= 3.8 as wheel is no longer "
31+
"The --no-wheel and -wheel options are deprecated. "
32+
"They have no effect for Python >= 3.8 as wheel is no longer "
3133
"bundled in virtualenv.",
3234
DeprecationWarning,
3335
stacklevel=1,
3436
)
37+
self.wheel_version = "none"
38+
self.no_wheel = True
3539

36-
self.no_pip = options.no_pip
37-
self.no_setuptools = options.no_setuptools
3840
self.app_data = options.app_data
3941
self.periodic_update = not options.no_periodic_update
4042

@@ -83,15 +85,17 @@ def add_parser_arguments(cls, parser, interpreter, app_data): # noqa: ARG003
8385
default=[],
8486
)
8587
for distribution, default in cls.distributions().items():
86-
if interpreter.version_info[:2] >= (3, 12) and distribution == "setuptools":
88+
help_ = f"version of {distribution} to install as seed: embed, bundle, none or exact version"
89+
if interpreter.version_info[:2] >= (3, 12) and distribution in {"wheel", "setuptools"}:
8790
default = "none" # noqa: PLW2901
8891
if interpreter.version_info[:2] >= (3, 9) and distribution == "wheel":
89-
continue
92+
default = None # noqa: PLW2901
93+
help_ = SUPPRESS
9094
parser.add_argument(
9195
f"--{distribution}",
9296
dest=distribution,
9397
metavar="version",
94-
help=f"version of {distribution} to install as seed: embed, bundle, none or exact version",
98+
help=help_,
9599
default=default,
96100
)
97101
for distribution in cls.distributions():

0 commit comments

Comments
 (0)