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

Fix cothread version parsing to handle suffixes #31

Conversation

AlexanderWells-diamond
Copy link
Contributor

@AlexanderWells-diamond AlexanderWells-diamond commented Nov 5, 2024

These suffixes are auto-generated from setuptools_scm, and are not usually just integers. For example 2.20.1.dev1+g82e2778.d20241105 is a valid version for Cothread. Such a version number is generated if you install from a Git checkout - see docs for details

This came up when attempting to create a pythonSoftIOC CI run that installed all of its dependencies directly from GitHub master branches - see this PR

These suffixes are auto-generated from setuptools_scm, and are not
usually just integers
# >= 2.16 will attempt to import this module
ver = tuple(int(c) for c in cothread.__version__.split("."))
Copy link
Member

Choose a reason for hiding this comment

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

Since the first two (or three?) pieces will always be integers, maybe some slicing would be simpler?

ver = tuple(int(c) for c in cothread.__version__.split(".")[:2])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is indeed much cleaner. Implemented in 811a856.

Suggested by Michael Davidsaver during review
@mdavidsaver mdavidsaver merged commit ea36f8d into epics-base:master Nov 5, 2024
34 checks passed
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.

2 participants