chore: rename gitlab/__version__.py -> gitlab/_version.py#1838
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1838 +/- ##
=======================================
Coverage 92.26% 92.26%
=======================================
Files 77 77
Lines 4849 4849
=======================================
Hits 4474 4474
Misses 375 375
Flags with carried forward coverage won't be shown. Click here to find out more.
|
a0cdb71 to
d9dfb5b
Compare
|
I don't think it's that confusing as it's quite a common pattern (e.g. https://github.com/mtkennerly/poetry-dynamic-versioning/blob/4454e5082bf1fc2f4a39fa523a9b665eda5d638f/poetry_dynamic_versioning/__init__.py#L86-L89 among others).
|
d9dfb5b to
1682830
Compare
I'm as big a fan of cargo-culting as the next person. But in our case due to the ordering of imports it is confusing. Because at some points in the code I did update the commit message to point out one actual situation of confusion.
Done! |
1682830 to
7984eb0
Compare
It is confusing to have a `gitlab/__version__.py` because we also create a variable `gitlab.__version__` which can conflict with `gitlab/__version__.py`. For example in `gitlab/const.py` we have to know that `gitlab.__version__` is a module and not the variable due to the ordering of imports. But in most other usage `gitlab.__version__` is a version string. To reduce confusion make the name of the version file `gitlab/_version.py`.
7984eb0 to
b981ce7
Compare
gitlab/__version__.py -> gitlab/version.pygitlab/__version__.py -> gitlab/_version.py
|
Ahh ok, that makes sense. Thanks! |
It is confusing to have a
gitlab/__version__.pybecause we alsocreate a variable
gitlab.__version__which can conflict withgitlab/__version__.py.For example in
gitlab/const.pywe have to know thatgitlab.__version__is a module and not the variable due to theordering of imports. But in most other usage
gitlab.__version__is aversion string.
To reduce confusion make the name of the version file
gitlab/_version.py.