ETHZ-TEC / RocketLogger

Official development repository of the RocketLogger project.
https://github.com/ETHZ-TEC/RocketLogger/wiki
BSD 3-Clause "New" or "Revised" License
14 stars 4 forks source link

Backwards compatibility of get_time() -OR- implementation of the __version__ attribute #45

Closed rtrueb closed 2 years ago

rtrueb commented 2 years ago

I'm using get_time(absolute_time=True, time_reference='network') in flocklab-tools which works fine with python support v1.1.6. However, in the new version (v2.0.0), the signature of the get_time function changed and is no longer backwards compatible (providing the absolute_time triggers an error). As a workaround, one could simply try to call both versions of the get_time() function. However, I think one of the proposals below would lead to a cleaner solution:

lsigrist commented 2 years ago

Thanks a lot for your input. The behavior you are referring to is one of the documented breaking API changes of version 2.0.0. Make sure to study the CHANGELOG to familiarize yourself with all breaking API changes. See also the documentation of the new API.

Regarding the two requests you're bringing up relating to this:

In general, I highly recommend not to write any code that needs to query the package version of a dependency: rather specify the dependency on a specific package version (or version range) in your package's setup.py. This guarantees a compatible environment already at installation time of your package.

rtrueb commented 2 years ago

Thank you for your detailed answer. I agree with your comments and I think it makes sense to stick to one version and specify the corresponding version number in the requirements of the package.

lsigrist commented 2 years ago

The RocketLogger Python package actually also suffers from not specifying the exact supported version of its dependencies, see #48.