Skip to content

Add version option to python_distribution - #258

Open
i-am-paradox wants to merge 1 commit into
pulp:developfrom
i-am-paradox:python_distribution_repository_version
Open

Add version option to python_distribution#258
i-am-paradox wants to merge 1 commit into
pulp:developfrom
i-am-paradox:python_distribution_repository_version

Conversation

@i-am-paradox

Copy link
Copy Markdown

This adds a version option to the python_distribution module, so a distribution can serve a specific RepositoryVersion instead of the latest one, as described in #248.

The option follows the same pattern as ansible_distribution: the repository name is combined with version to build the repository_version href (versions_href + f"{version}/") and send that to the API. Without version, behavior is unchanged: the repository href is sent and the latest version is served, as before.

version requires repository (enforced through required_by, and also checked when repository is set to the empty string, in which case a version would have nothing to refer to).

The Pulp API endpoint accepts the repository_version field on distribution create/update, so no API changes are involved.

Validation done locally: the module compiles, DOCUMENTATION and EXAMPLES parse as valid YAML with the new option and example, and flake8 reports exactly the same 9 pre-existing findings as on develop, none introduced by this change.

Fixes #248

Allow serving a specific RepositoryVersion of a python repository by
combining the repository option with a new version option, following
the same pattern already used by ansible_distribution.

Fixes pulp#248

@mdellweg mdellweg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

python_distribution lacks the repository_version parameter

2 participants