Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .ci/scripts/check_click_for_mypy.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/env python3

from importlib.metadata import version
from importlib import metadata

from packaging.version import parse
from packaging.version import Version

click_version = version("click")

if parse(click_version) < parse("8.1.1") or parse(click_version) >= parse("8.2"):
print("🚧 Linting with mypy is currently only supported with click~=8.1.1. 🚧")
print("🔧 Please run `pip install click~=8.1.1` first. 🔨")
exit(1)
if __name__ == "__main__":
click_version = Version(metadata.version("click"))
if click_version < Version("8.1.1"):
print("🚧 Linting with mypy is currently only supported with click>=8.1.1. 🚧")
print("🔧 Please run `pip install click>=8.1.1` first. 🔨")
exit(1)
1 change: 1 addition & 0 deletions CHANGES/+click_8.2.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for click 8.2.
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/bin/env python3

import click
from packaging.version import parse
from importlib import metadata

if parse(click.__version__) < parse("8.1.1") or parse(click.__version__) >= parse("8.2"):
print("🚧 Linting with mypy is currently only supported with click~=8.1.1. 🚧")
print("🔧 Please run `pip install click~=8.1.1` first. 🔨")
exit(1)
from packaging.version import Version

if __name__ == "__main__":
click_version = Version(metadata.version("click"))
if click_version < Version("8.1.1"):
print("🚧 Linting with mypy is currently only supported with click>=8.1.1. 🚧")
print("🔧 Please run `pip install click>=8.1.1` first. 🔨")
exit(1)
2 changes: 1 addition & 1 deletion pulpcore/cli/core/task_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
_ = translation.gettext


@pulp_group()
@pulp_group(name="task-group")
@pass_pulp_context
@click.pass_context
def task_group(ctx: click.Context, pulp_ctx: PulpCLIContext, /) -> None:
Expand Down
6 changes: 1 addition & 5 deletions pulpcore/cli/rpm/prune.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
@multi_repository_option
@click.option(
"--all-repositories",
type=bool,
is_flag=True,
show_default=True,
default=False,
help=_("Prune *all* repositories accessible to the invoking user."),
)
Expand All @@ -47,9 +45,7 @@
)
@click.option(
"--dry-run",
type=bool,
is_flag=True,
show_default=True,
default=False,
help=_("Evaluate the prune-status of the specified repositories but DO NOT make any changes."),
)
Expand All @@ -73,7 +69,6 @@ def prune_packages(

You may not specify --all-repositories *and* one or more specific repositories.
"""
prune_ctx = PulpRpmPruneContext(pulp_ctx)
if not (all_repositories or repositories):
raise PulpException(
_("at least one --repository, or --all-repositories, must be specified")
Expand All @@ -87,5 +82,6 @@ def prune_packages(
["*"] if all_repositories else list(repositories)
)

prune_ctx = PulpRpmPruneContext(pulp_ctx)
result = prune_ctx.prune_packages(repos_list, keep_days, dry_run)
pulp_ctx.output_result(result)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ classifiers=[
]
dependencies = [
"pulp-glue==0.33.0.dev",
"click>=8.0.0,<8.2", # Proven to not do semver.
"click>=8.0.0,<8.3", # Proven to not do semver.
"PyYAML>=5.3,<6.1",
"schema>=0.7.5,<0.8",
"tomli>=2.0.0,<2.1;python_version<'3.11'",
Expand Down
5 changes: 4 additions & 1 deletion tests/test_help_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ def test_access_help(no_api: None, subtests: SubTests) -> None:
result = runner.invoke(main, args + ["--help"], catch_exceptions=False)

if result.exit_code == 2:
assert "not available in this context" in result.stdout
assert (
"not available in this context" in result.stdout
or "not available in this context" in result.stderr
)
else:
assert result.exit_code == 0
assert result.stdout.startswith("Usage:") or result.stdout.startswith(
Expand Down
Loading