labscript-suite / runmanager

𝗿𝘂𝗻𝗺𝗮𝗻𝗮𝗴𝗲𝗿 is an intuitive graphical interface for controlling 𝘭𝘢𝘣𝘴𝘤𝘳𝘪𝘱𝘵 𝘴𝘶𝘪𝘵𝘦 experiments. Includes multi-dimensional parameter scans and a remote programming interface for automation.
http://labscriptsuite.org
Other
3 stars 45 forks source link

Obtain own version without external functions #81

Closed chrisjbillington closed 4 years ago

chrisjbillington commented 4 years ago

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 best

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. 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.

rpanderson commented 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.

chrisjbillington commented 4 years ago

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!