labscript-suite / labscript-utils

Shared modules used by the 𝘭𝘒𝘣𝘴𝘀𝘳π˜ͺ𝘱𝘡 𝘴𝘢π˜ͺ𝘡𝘦. Includes a graphical exception handler, debug tools, configuration management, cross platform filepath conversions, unit conversions and custom GUI widgets.
http://labscriptsuite.org
Other
2 stars 47 forks source link

Restore check_version #62

Closed chrisjbillington closed 3 years ago

chrisjbillington commented 4 years ago

labscript_utils 3.0.0 removed the check_version function. This was because it was no longer used by the labscript suite, which now manages its dependencies using pip/conda. However, code that is distributed in forms other than packages on PyPI/anaconda cloud, particularly code living in userlib, cannot use pip/conda to manage versions of its dependencies, so it is still useful to provide a function to do runtime checks.

So we should add it back in

See brief discussion here

philipstarkey commented 4 years ago

I think we should add it back in. We should consider not using distutils.version though (which I believe is both undocumented and not PEP440 compliant). Instead we should probably use packaging.version which is also already in our dependency tree (setuptools_scm depends on setuptools which depends on packaging). My understanding is that packaging.version handles comparison of development versions correctly (which is why I used it in #61)

chrisjbillington commented 4 years ago

Excellent, sounds like packaging.version is the way to go then.