Skip to content

refactor: move Gitlab and GitlabList to gitlab/client.py #1301

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2021
Merged

refactor: move Gitlab and GitlabList to gitlab/client.py #1301

merged 1 commit into from
Feb 20, 2021

Conversation

JohnVillalovos
Copy link
Member

Move the classes Gitlab and GitlabList from gitlab/init.py to the
newly created gitlab/client.py file.

Update one test case that was depending on requests being defined in
gitlab/init.py

@codecov-io
Copy link

codecov-io commented Feb 15, 2021

Codecov Report

Merging #1301 (896385c) into master (bec2094) will decrease coverage by 0.02%.
The diff coverage is 80.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1301      +/-   ##
==========================================
- Coverage   80.58%   80.55%   -0.03%     
==========================================
  Files          65       66       +1     
  Lines        3240     3585     +345     
==========================================
+ Hits         2611     2888     +277     
- Misses        629      697      +68     
Flag Coverage Δ
unit 80.55% <80.28%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
gitlab/client.py 80.28% <80.28%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bec2094...896385c. Read the comment docs.

Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @JohnVillalovos!

I think you had this mind already if I remember @max-wittig WDYT? It can be split more in a later PR if it balloons.. maybe the http requests stuff could go in its own module at some point.

@@ -32,6 +27,7 @@
__title__,
__version__,
)
from gitlab.client import Gitlab, GitlabList
from gitlab.const import * # noqa
from gitlab.exceptions import * # noqa
from gitlab import utils # noqa
Copy link
Member

@nejch nejch Feb 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these 2 imports still needed here (utils and requests_toolbelt)? I think they would only be used internally in client.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can remove them

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a note when I removed:

from gitlab import utils

The functional CLI test failed. So I put it back in.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect those might have just been some flaky functional tests, but I agree. we can keep it for now

@JohnVillalovos
Copy link
Member Author

I've updated it and hopefully addressed all the feedback. Thank you.

Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @JohnVillalovos for the delay, could you just rebase? It's just this one added line 2bb16fa#diff-b0f8dbe3635cab16df9ce4bef4498422dbc0e6ad816820e00637f8f4e4d3bed0R146

Otherwise looks nice to have a clean init, unless @max-wittig has any more comments :)

Move the classes Gitlab and GitlabList from gitlab/__init__.py to the
newly created gitlab/client.py file.

Update one test case that was depending on requests being defined in
gitlab/__init__.py
@JohnVillalovos
Copy link
Member Author

Sorry @JohnVillalovos for the delay, could you just rebase? It's just this one added line 2bb16fa#diff-b0f8dbe3635cab16df9ce4bef4498422dbc0e6ad816820e00637f8f4e4d3bed0R146

Otherwise looks nice to have a clean init, unless @max-wittig has any more comments :)

Done I believe. But please double check. I believe everything in the two classes (Gitlab and GitlabList) have been moved correctly to the new file from commit d4e7a03

@nejch
Copy link
Member

nejch commented Feb 20, 2021

Sorry @JohnVillalovos for the delay, could you just rebase? It's just this one added line 2bb16fa#diff-b0f8dbe3635cab16df9ce4bef4498422dbc0e6ad816820e00637f8f4e4d3bed0R146
Otherwise looks nice to have a clean init, unless @max-wittig has any more comments :)

Done I believe. But please double check. I believe everything in the two classes (Gitlab and GitlabList) have been moved correctly to the new file from commit d4e7a03

Thanks, just checked with git diff --color-moved=dimmed-zebra origin/master and looks good.

@nejch nejch merged commit 2c4fcf8 into python-gitlab:master Feb 20, 2021
@JohnVillalovos JohnVillalovos deleted the refactor_jlvillal branch February 24, 2021 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants