Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version constrain >=x.y.z doesn't include unreleased plugin code x.y.z.dev on tests #852

Closed
pedro-psb opened this issue Dec 13, 2023 · 2 comments · Fixed by #857
Closed
Labels
Documentation Improvements or additions to documentation Triage-Needed Needs to be reviewed at next pulp-cli mtg

Comments

@pedro-psb
Copy link
Member

Summary

When writting a test for a plugin that contains a version constrains >=x.y.z, the test won't recognize x.y.z.dev as being part of that constrain specification.

Steps to reproduce

Create a test file and run it with pytest:

from pulp_glue.common.context import PluginRequirement

def test_dev_version_gte_base_version():
    plugin_requirement = PluginRequirement("plugin", specifier=">=3.25.0")
    assert "3.25.0" in plugin_requirement # succeeds
    assert "3.25.0.dev" in plugin_requirement # fails

Expected behavior

Unreleased version (developer versions) of those constrains to be recognized as part of the case specification.

Pulp and pulp-cli version info

pulpcore: 3.42.0.dev
pulp-cli: 0.23.0.dev0

Additonal context

When some feature will be added or removed from a plugin, often this should be reflected in the CLI.
It would be convenient to allow testing those changes as if they were released, without having to wait the real release.

If that's not something desirable at all, we could add that in the docs to clarify one should wait the plugin changes to be released before doing in the CLI.

@pedro-psb pedro-psb added bug Something isn't working (template-set) Triage-Needed Needs to be reviewed at next pulp-cli mtg labels Dec 13, 2023
@mdellweg
Copy link
Member

This is working as designed. We are following pythons version sorting here.
If you want to include dev versions, you can specify the requirement with ".dev". But they are inherently dangerous, because the same dev-version may look different before and after a merge.

@pedro-psb
Copy link
Member Author

Yeah, I see your point.
I will propose some small doc improvements to clarify this fact, then.

@pedro-psb pedro-psb added Documentation Improvements or additions to documentation and removed bug Something isn't working (template-set) labels Dec 14, 2023
pedro-psb added a commit to pedro-psb/pulp-cli that referenced this issue Jan 4, 2024
When some feature will be added or removed from a plugin, often this
should be reflected in the CLI, but for it to be properly tested,
that change should be already released. Using .dev versions isn't
be reliable.

closes pulp#852
pedro-psb added a commit to pedro-psb/pulp-cli that referenced this issue Jan 8, 2024
When some feature will be added or removed from a plugin, often this
should be reflected in the CLI, which requires some special care.

Co-authored-by: Matthias Dellweg <2500@gmx.de>
closes pulp#852
mdellweg pushed a commit that referenced this issue Jan 8, 2024
When some feature will be added or removed from a plugin, often this
should be reflected in the CLI, which requires some special care.

Co-authored-by: Matthias Dellweg <2500@gmx.de>
closes #852
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation Triage-Needed Needs to be reviewed at next pulp-cli mtg
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants