This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
pulp-cli-console is a CLI plugin for Pulp that adds console administrative commands (task management, vulnerability reports, domain management). It extends pulp-cli via the entry points plugin system.
make build # Build both packages (CLI + glue)
make format # Auto-format with isort + black
make lint # Run all linting (shellcheck, isort, black, flake8, mypy)
make test # Run all tests (requires Pulp server; copies tests/cli.toml.example if needed)
make livetest # Run only integration tests (marker: live)
make unittest # Run only unit tests (marker: not live)
make unittest_glue # Run only glue unit testsRun a single test:
python3 -m pytest -v tests/test_file.py::test_function_name
python3 -m pytest -v -m pulp_console # by markerMypy for the CLI package requires: MYPYPATH=pulp-glue-console mypy
The repo contains two separate Python packages that are versioned and released together:
- pulp-cli-console (root
pyproject.toml) — Click-based CLI commands underpulpcore/cli/console/ - pulp-glue-console (
pulp-glue-console/pyproject.toml) — API client layer underpulp-glue-console/pulp_glue/console/
Both use PEP 420 namespace packages (pulpcore.cli.* and pulp_glue.*). Versions must stay synchronized — bump-my-version handles this across all files.
__init__.py— Pluginmount()entry point. Patches OpenAPI to handle HTTP 202 responses. Creates thepulp consolecommand group and attaches subcommands.task.py—pulp console task listwith extensive filteringvulnerability.py—pulp console vulnerability {list,show,npm,rpm}populated_domain.py—pulp console populated-domain create
Commands follow the pattern: define an attach_*_commands(group) function that adds Click commands to the console group.
context.py—PulpVulnerabilityReportContext(entity-based, extendsPulpEntityContext) andAdminTaskContext(direct API calls). Contexts encapsulate all Pulp REST API interaction.
- Line length: 100 (black, isort, flake8 all configured consistently)
- isort: black profile
- mypy: strict mode
- Fully typed codebase with
py.typedmarkers
- Changelog entries go in
CHANGES/as{issue_number}.{feature,bugfix,removal,devel,misc}files (towncrier) - Commits must reference issues (
fixes #123orcloses #123) - No
[noissue],WIP,DRAFT, orDO NOT MERGEin commit messages
Registered via entry point in pyproject.toml:
[project.entry-points."pulp_cli.plugins"]
console = "pulpcore.cli.console"pulp-cli discovers this and calls the mount(main, **kwargs) function in __init__.py.