Skip to content

Commit

Permalink
Fix cothread version parsing to handle suffixes (#31)
Browse files Browse the repository at this point in the history
Fix cothread version parsing to handle suffixes

These suffixes are auto-generated from setuptools_scm, and are not
usually just integers
  • Loading branch information
AlexanderWells-diamond authored Nov 5, 2024
1 parent de99053 commit ea36f8d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/python/epicscorelibs/path/cothread.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ def check_cothread_order():
if "cothread" not in sys.modules:
return
cothread = sys.modules.get("cothread")

# Slice to first two elements to avoid attempting to parse certain types
# of auto-generated version numbers that are generated from setuptools_scm
# inside of cothread. e.g. trying to install directly from Github yields a
# version like "2.20.1.dev1+g82e2778.d20241105".
ver = tuple(int(c) for c in cothread.__version__.split(".")[:2])

# >= 2.16 will attempt to import this module
ver = tuple(int(c) for c in cothread.__version__.split("."))
if ver < (2, 16):
warnings.warn("epicscorelibs.path.cothread must be imported before cothread.catools to have effect")

Expand Down

0 comments on commit ea36f8d

Please sign in to comment.