Closed chrisjbillington closed 4 years ago
We could have kept this version check function within labscript_utils, but I think it makes more sense to keep it in each project so that it can stay in sync with that project's config rather than labscript-suite-wide config that if in labscript-utils will not necessarily change in sync with each project.
Can this argument be generalised to remove similar shared functionality from labscript-utils?
So I think it's better if each project is in charge of its own version checks.
I concur.
Can this argument be generalised to remove similar shared functionality from labscript-utils?
To some extent. There's no clear line but I'm pretty sure self-versions are on this side of it!
Don't import labscript_utils to get own version, instead rely on simpler check within
__version__.py
This returns setuptools_scm's version wit the given config if in a VCS folder, otherwise falling back to whatever importlib_metadata returns.
Unfortunately this means duplicating some configuration in
setup.py
and__version__.py
to ensure they give identical results, but I think it's for the bestWe could have kept this version check function within labscript_utils, but I think it makes more sense to keep it in each project so that it can stay in sync with that project's config rather than labscript-suite-wide config that if in labscript-utils will not necessarily change in sync with each project. So I think it's better if each project is in charge of its own version checks.
With this change and changes like #80, labscript_utils.versions starts to play a much more minor role and can be stripped down and have much of its complexity and magic removed.