openzim / python-libzim

Libzim binding for Python: read/write ZIM files in Python
https://pypi.org/project/libzim/
GNU General Public License v3.0
60 stars 19 forks source link

Introducing printVersions() and getVersions() #159

Closed rgaudin closed 1 year ago

rgaudin commented 1 year ago

This is a follow-up of #158 and fixes #148 as well.

This includes @FledgeXu's PR but improves the Python API

- Better docstring
- Refactored to uses module functions instead of (useless) Version class
- Changed get_versions() to return an OrderedDict for easier in-python use
- Added get_libzim_version() shortcut
- Simplified print_version's code
- Fixed print_version tests (use flush so we're sure its present when checking)
- Changed tests for get_versions and get_libzim_version
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.29 :tada:

Comparison is base (d972b4a) 92.88% compared to head (0634086) 93.18%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #159 +/- ## ========================================== + Coverage 92.88% 93.18% +0.29% ========================================== Files 1 1 Lines 464 484 +20 ========================================== + Hits 431 451 +20 Misses 33 33 ``` | [Impacted Files](https://codecov.io/gh/openzim/python-libzim/pull/159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openzim) | Coverage Δ | | |---|---|---| | [libzim/libzim.pyx](https://codecov.io/gh/openzim/python-libzim/pull/159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openzim#diff-bGliemltL2xpYnppbS5weXg=) | `93.18% <100.00%> (+0.29%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openzim). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openzim)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

FledgeXu commented 1 year ago

Thanks for your improvement!