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
4 changes: 2 additions & 2 deletions .ci/scripts/check_cli_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def dependencies(path: Path) -> t.Iterator[Requirement]:
base_path = Path(__file__).parent.parent.parent
glue_path = base_path / GLUE_DIR

cli_dependency = next((r for r in dependencies(base_path) if r.name == "pulp-cli"))
glue_dependency = next((r for r in dependencies(glue_path) if r.name == "pulp-glue"))
cli_dependency = next(r for r in dependencies(base_path) if r.name == "pulp-cli")
glue_dependency = next(r for r in dependencies(glue_path) if r.name == "pulp-glue")

if cli_dependency.specifier != glue_dependency.specifier:
print("🪢 CLI and GLUE dependencies mismatch:")
Expand Down
4 changes: 2 additions & 2 deletions src/pulpcore/cli/workflow/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def create(
entity_ctx: PulpEntityContext,
/,
name: str,
start_time: t.Optional[datetime],
dispatch_interval: t.Optional[str],
start_time: datetime | None,
dispatch_interval: str | None,
tasks: tuple[str, ...],
pulp_labels: tuple[str, ...],
) -> None:
Expand Down
19 changes: 9 additions & 10 deletions tests/test_help_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,22 @@
load_plugins()


def traverse_commands(command: click.Command, args: t.List[str]) -> t.Iterator[t.List[str]]:
def traverse_commands(command: click.Command, args: list[str]) -> t.Iterator[list[str]]:
yield args

if isinstance(command, click.Group):
for name, sub in command.commands.items():
yield from traverse_commands(sub, args + [name])

params = command.params
if params:
if "--type" in params[0].opts:
# iterate over commands with specific context types
assert isinstance(params[0].type, click.Choice)
for context_type in params[0].type.choices:
yield args + ["--type", context_type]
if params and "--type" in params[0].opts:
# iterate over commands with specific context types
assert isinstance(params[0].type, click.Choice)
for context_type in params[0].type.choices:
yield args + ["--type", context_type]

for name, sub in command.commands.items():
yield from traverse_commands(sub, args + ["--type", context_type, name])
for name, sub in command.commands.items():
yield from traverse_commands(sub, args + ["--type", context_type, name])


@pytest.fixture
Expand All @@ -45,7 +44,7 @@ def test_access_help(no_api: None) -> None:
pytest.skip("This test is incompatible with older cli versions.")

runner = CliRunner()
failures: t.List[str] = []
failures: list[str] = []
for args in traverse_commands(main.commands["workflow"], ["workflow"]):
result = runner.invoke(main, args + ["--help"], catch_exceptions=False)

Expand Down
Loading