Skip to main content

Pulp Tool

Unit tests codecov

A Python client for Pulp API operations including RPM and file management.

Overview: Setup · Usage and API · Development · License

Setup

Konflux / Red Hat Pulp access (primary)

In Konflux, Pulp access is provisioned by the pulp-access-controller operator—not by hand-editing cli.toml or creating terms-based registry credentials yourself.

  1. Create a PulpAccessRequest in your namespace (see the operator README and Konflux: Getting access to Pulp storage).
  2. The controller creates a pulp-access secret with cli.toml, authentication material, and domain name (konflux-<namespace>). It uses Red Hat's terms-based registry for credentials—you do not create those credentials yourself; the controller generates and manages them.

Tekton tasks mount that secret (for example /pulp-access/cli.toml) and run pulp-tool --config …. See CLAUDE.md for downstream flag and path contracts.

Local install and manual config

Clone and install:

git clone https://github.com/konflux-ci/pulp-tool.git
cd pulp-tool
pip install -e .

For development (dev dependencies and pre-commit):

pip install -e ".[dev]"

Create ~/.config/pulp/cli.toml for local use when you are not consuming a controller-generated pulp-access secret. Use the [cli] keys pulp-tool reads: base_url, api_root, domain, OAuth (client_id, client_secret) or Basic Auth (username, password), optional client cert (cert, key), and optional correlation_id for X-Correlation-ID (or set PULP_TOOL_CORRELATION_ID). See docs/cli-reference.md for access provisioning and command flags.

When --build-id and --namespace are set and no correlation id is configured, the client sends X-Correlation-ID: {namespace}/{build_id} (or the build id alone if namespace is omitted), similar to pulp-cli.

packages.redhat.com (manual / non-Konflux): use Basic Auth; [cli] can set base_url = "https://packages.redhat.com", api_root = "/api/pulp/", username, password, and domain. OAuth2 (client_id / client_secret) is also supported. For distribution pull, add cert and key paths or use username/password via --distribution-config. Konflux namespaces should use pulp-access-controller instead of ad hoc config.

Usage and API

pulp-tool --config ~/.config/pulp/cli.toml \
  --build-id my-build-123 \
  --namespace my-namespace \
  upload \
  --parent-package my-package \
  --rpm-path /path/to/rpms \
  --sbom-path /path/to/sbom.json
pulp-tool --config ~/.config/pulp/cli.toml \
  upload \
  --results-json /path/to/pulp_results.json \
  --signed-by key-id-123
pulp-tool pull \
  --artifact-location /path/to/artifacts.json \
  --transfer-dest ~/.config/pulp/cli.toml

pulp-tool --config ~/.config/pulp/cli.toml search-by --checksums <sha256>
pulp-tool --help
pulp-tool upload --help
pulp-tool search-by --help

Full command tables, examples, and logging: docs/cli-reference.md.

from pulp_tool import PulpClient, PulpHelper
from pulp_tool.models import RepositoryRefs

client = PulpClient.create_from_config_file(path="~/.config/pulp/cli.toml")
try:
    helper = PulpHelper(client)
    repos: RepositoryRefs = helper.setup_repositories("my-build-123")

    response = client.upload_rpm_package(
        "/path/to/package.rpm",
        labels={"build_id": "my-build-123"},
        arch="x86_64",
    )
finally:
    client.close()
from pulp_tool import DistributionClient

dist = DistributionClient(cert="/path/to/cert.pem", key="/path/to/key.pem")
dist = DistributionClient(username="user", password="pass")

metadata = dist.pull_artifact("https://pulp.example.com/artifacts.json").json()
dist.pull_data(filename="pkg.rpm", file_url="...", arch="x86_64", artifact_type="rpm")

Models: RepositoryRefs, UploadContext, PullContext, ArtifactMetadata, PulpResultsModel, PulledArtifacts.

Development

Konflux / Tekton: pulp-tool runs in RPM build (import-to-quay) and release (push-artifacts-to-storage) tasks. If you change upload, SBOM/artifact behavior, or the container image, read CLAUDE.md for contracts and regression checks; re-verify konflux-ci/rpmbuild-pipeline (task/import-to-quay.yaml) and konflux-ci/release-service-catalog (tasks/managed/push-artifacts-to-storage/). Pipelines evolve (e.g. ORAS or oras-staging/); update CLAUDE.md when upstream staging changes. Architecture overview: docs/ARCHITECTURE.md.

make install-dev          # editable install + pre-commit (+ pre-push) hooks
make format               # ruff format + ruff check --fix
make lint                 # ruff, pylint, mypy (same as CI python-lint job)
make pre-commit-ci        # all pre-commit hooks: lint + pip-audit + diff-cover + checkton
pre-commit run --all-files   # commit-stage hooks only; loop until green
make test                 # full suite + coverage (85%+ project threshold)
make test-container       # optional local Dockerfile smoke-test (Konflux Tekton builds the image on PR/push)
git fetch origin
make test-diff-coverage   # PR gate: 100% diff vs COMPARE_BRANCH (default origin/main)
make check                # lint + test

Dependency lockfile: uv.lock is generated from pyproject.toml; after changing dependencies, run make lock.

Before a PR, ensure make pre-commit-ci (or commit + pre-push pre-commit stages) and make test are green. For AI-assisted work see AGENTS.md (start with § Bootstrap), docs/ARCHITECTURE.md, and CLAUDE.md (Konflux contracts); also CONTRIBUTING.md and tests/README.md. Maintainers: docs/releasing.md. Optional AgentReady: pip install agentready && agentready assess . (.agentready-config.yaml; reports under .agentready/, gitignored).

Troubleshooting

Issue Check
Command not found pip install -e . or pip install pulp-tool
Authentication errors Verify ~/.config/pulp/cli.toml credentials
SSL/TLS errors Verify cert/key paths and permissions
Permission denied Check file permissions on artifacts and key

Contributing: fork, branch, change with tests, then make test and make pre-commit-ci (or make test-diff-coverage after git fetch origin), and open a pull request.

License

Apache License 2.0. See LICENSE.

Metadata

Release files for pulp-tool 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pulp-tool 1.1.0
File Size Uploaded Provenance Actions
pulp_tool-1.1.0.tar.gz 421.2 kB With provenance Details for pulp_tool-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pulp-tool 1.1.0
File Interpreter ABI Platform Actions
pulp_tool-1.1.0-py3-none-any.whl Python 3 none any Details for pulp_tool-1.1.0-py3-none-any.whl

Total release size: 592.9 kB

Release files / pulp_tool-1.1.0.tar.gz

Download URL pulp_tool-1.1.0.tar.gz
Size 421.2 kB
Tags Source
SHA-256 checksum
How to use checksums
aec5901d11101cb2010ecd751792346f5dffddd35d7facc3eafec91e5c26e270
BLAKE2b-256 checksum
How to use checksums
1917f820501645b8d7d181a3e8427ea415ad8024320f3456cbf277fcbca892f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release files / pulp_tool-1.1.0-py3-none-any.whl

Download URL pulp_tool-1.1.0-py3-none-any.whl
Size 171.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07fbaa1b622e0fbc662f6e670c5954d9f991ac152fd9f8484fd03f942c3a8d8c
BLAKE2b-256 checksum
How to use checksums
b12aee6e95600947d404536ec423d7b5ab49bfe772ec3463c1eea187631f0d60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Security for pulp-tool 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pulp_tool-1.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page