Add version option to python_distribution - #258
Open
i-am-paradox wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a
versionoption 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 withversionto build therepository_versionhref (versions_href + f"{version}/") and send that to the API. Withoutversion, behavior is unchanged: the repository href is sent and the latest version is served, as before.versionrequiresrepository(enforced throughrequired_by, and also checked whenrepositoryis set to the empty string, in which case a version would have nothing to refer to).The Pulp API endpoint accepts the
repository_versionfield 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