Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: renamegitlab/__version__.py ->gitlab/_version.py#1838

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nejch merged 1 commit intomainfromjlvillal/version_mv
Jan 15, 2022

Conversation

@JohnVillalovos
Copy link
Member

@JohnVillalovosJohnVillalovos commentedJan 14, 2022
edited
Loading

It is confusing to have agitlab/__version__.py because we also
create a variablegitlab.__version__ which can conflict with
gitlab/__version__.py.

For example ingitlab/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 usagegitlab.__version__ is a
version string.

To reduce confusion make the name of the version file
gitlab/_version.py.

@codecov-commenter
Copy link

codecov-commenter commentedJan 14, 2022
edited
Loading

Codecov Report

Merging#1838 (b981ce7) intomain (cbbe7ce) willnot change coverage.
The diff coverage is100.00%.

@@           Coverage Diff           @@##             main    #1838   +/-   ##=======================================  Coverage   92.26%   92.26%           =======================================  Files          77       77             Lines        4849     4849           =======================================  Hits         4474     4474             Misses        375      375
FlagCoverage Δ
cli_func_v481.29% <100.00%> (ø)
py_func_v480.26% <100.00%> (-0.05%)⬇️
unit83.29% <100.00%> (ø)

Flags with carried forward coverage won't be shown.Click here to find out more.

Impacted FilesCoverage Δ
gitlab/_version.py100.00% <ø> (ø)
gitlab/__init__.py100.00% <100.00%> (ø)
gitlab/const.py100.00% <100.00%> (ø)
gitlab/mixins.py91.50% <0.00%> (ø)
gitlab/v4/objects/files.py100.00% <0.00%> (ø)

@JohnVillalovosJohnVillalovosforce-pushed thejlvillal/version_mv branch 2 times, most recently froma0cdb71 tod9dfb5bCompareJanuary 14, 2022 01:55
@nejch
Copy link
Member

nejch commentedJan 15, 2022
edited
Loading

I don't think it'sthat 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).

version.py could also be confusing as we havehttps://docs.gitlab.com/ee/api/version.html, so maybe we could do_version.py then, to signify it's not anything to do with it?

@JohnVillalovos
Copy link
MemberAuthor

JohnVillalovos commentedJan 15, 2022
edited
Loading

I don't think it'sthat 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).

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__version__ is the version string, but in other locations it is a module. Which I have found confusing when trying to work on the code as I need to understand where in the import cycle we are to know which value it is.

I did update the commit message to point out one actual situation of confusion.

version.py could also be confusing as we havehttps://docs.gitlab.com/ee/api/version.html, so maybe we could do_version.py then, to signify it's not anything to do with it?

Done!

It is confusing to have a `gitlab/__version__.py` because we alsocreate 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 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`.
@JohnVillalovosJohnVillalovos changed the titlechore: renamegitlab/__version__.py ->gitlab/version.pychore: renamegitlab/__version__.py ->gitlab/_version.pyJan 15, 2022
@nejch
Copy link
Member

Ahh ok, that makes sense. Thanks!

JohnVillalovos reacted with thumbs up emoji

@nejchnejch merged commit8af403c intomainJan 15, 2022
@nejchnejch deleted the jlvillal/version_mv branchJanuary 15, 2022 16:42
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@JohnVillalovos@codecov-commenter@nejch

[8]ページ先頭

©2009-2025 Movatter.jp