-
Notifications
You must be signed in to change notification settings - Fork 670
refactor: explicitly import gitlab.const values into top-level namespace #1694
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fd04824
to
ba3b38a
Compare
ba3b38a
to
cf92904
Compare
Codecov Report
@@ Coverage Diff @@
## main #1694 +/- ##
==========================================
+ Coverage 92.01% 92.02% +0.01%
==========================================
Files 75 75
Lines 4670 4676 +6
==========================================
+ Hits 4297 4303 +6
Misses 373 373
Flags with carried forward coverage won't be shown. Click here to find out more.
|
nejch
reviewed
Nov 17, 2021
7295a13
to
ffc535f
Compare
nejch
reviewed
Nov 28, 2021
ffc535f
to
f83738f
Compare
f83738f
to
ee25bcd
Compare
We are planning on adding enumerated constants into gitlab/const.py, but if we do that than they will end up being added to the top-level gitlab namespace. We really want to get users to start using `gitlab.const.` to access the constant values in the future. Add the currently defined constants to a list that should not change. Use a module level __getattr__ function so that we can deprecate access to the top-level constants. Add a unit test which verifies we generate a warning when accessing the top-level constants.
Have code use constants from the gitlab.const module instead of from the top-level gitlab module.
Update the docs to use gitlab.const to access constants.
ee25bcd
to
b3b0b5f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We are planning on adding enumerated constants into gitlab/const.py,
but if we do that than they will end up being added to the top-level
gitlab namespace. We really want to get users to start using
gitlab.const.
to access the constant values in the future.Explicitly add the current values defined in gitlab.const into the
top-level namespace and stop using the previous
'from gitlab.const import *' method.