Skip to content

Commit 2f5f38b

Browse files
committed
Bump click version to allow 8.3
1 parent 0f06dd0 commit 2f5f38b

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

pulp_cli/generic.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@
4949
else:
5050
SECRET_STORAGE = True
5151

52+
try:
53+
# Sentinel is introduced in click 8.3.
54+
# We need to use it to identify unset values.
55+
_UNSET = click._utils.Sentinel.UNSET # type: ignore[attr-defined]
56+
57+
def _unset(value: t.Any) -> bool:
58+
return value is _UNSET or value is None or value == () or value == []
59+
60+
except AttributeError:
61+
62+
def _unset(value: t.Any) -> bool:
63+
return value is None or value == () or value == []
64+
65+
5266
translation = get_translation(__package__)
5367
_ = translation.gettext
5468

@@ -474,7 +488,7 @@ def __init__(
474488
super().__init__(*args, **kwargs)
475489

476490
def process_value(self, ctx: click.Context, value: t.Any) -> t.Any:
477-
if self.needs_plugins and value is not None and value != ():
491+
if self.needs_plugins and not _unset(value):
478492
pulp_ctx = ctx.find_object(PulpCLIContext)
479493
assert pulp_ctx is not None
480494
for plugin_requirement in self.needs_plugins:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ classifiers=[
2424
]
2525
dependencies = [
2626
"pulp-glue==0.37.0.dev",
27-
"click>=8.0.0,<8.3", # Proven to not do semver.
27+
"click>=8.0.0,<8.4", # Proven to not do semver.
2828
"PyYAML>=5.3,<6.1",
2929
"schema>=0.7.5,<0.8",
3030
"tomli>=2.0.0,<2.1;python_version<'3.11'",

0 commit comments

Comments
 (0)