mozilla / mozanalysis

A library for Mozilla experiments analysis
https://mozilla.github.io/mozanalysis/
Mozilla Public License 2.0
9 stars 13 forks source link

feat: add __version__ attribute #209

Closed jaredsnyder closed 5 months ago

jaredsnyder commented 5 months ago

This is meant to address this issue: https://github.com/mozilla/mozanalysis/issues/11

One can access the version using the version attribute:

>>> import mozanalysis
>>> mozanalysis.__version__
'2023.11.4.dev12+g230bf07.d20240227'

It looks like the version is generated by setuptools_scm, and it gets grabbed by importlib.metadata. We could add a little logic just to grab the date part of it so it matches with the git tags.

jaredsnyder commented 5 months ago

The tests are failing because of an issue with python 3.8 and the latest version of pytest. I can fix the issue by setting the pytest version to be <7 but I don't know if that makes sense for such a trivial change

dzeber commented 5 months ago

The tests are failing because of an issue with python 3.8 and the latest version of pytest. I can fix the issue by setting the pytest version to be <7 but I don't know if that makes sense for such a trivial change

I think the long-term solution is probably to bump the python version for testing. I opened #210 for this.

mikewilli commented 5 months ago

Unless this is urgent, we can probably block it on #210? If this is urgent or #210 turns out to be more annoying than expected, go ahead and pin pytest, but as a separate PR that can be merged first.

mikewilli commented 5 months ago

I should clarify that I don't see any downstream impacts, adding __version__ should be harmless.

jaredsnyder commented 5 months ago

Unless this is urgent, we can probably block it on #210? If this is urgent or #210 turns out to be more annoying than expected, go ahead and pin pytest, but as a separate PR that can be merged first.

Not urgent, I agree we should wait for #210