-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support deprecation info in Config #1275
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1275 +/- ##
=======================================
Coverage 68.42% 68.43%
=======================================
Files 160 160
Lines 10610 10619 +9
Branches 1938 1941 +3
=======================================
+ Hits 7260 7267 +7
Misses 2975 2975
- Partials 375 377 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
The modification LGTM. It would be better to also update the documentation thus the users could know it right after this PR. |
It would be great to provide a link to the related pr |
I see |
You mean adding a key to the |
Yes, the pr will be very helpful since its diff provides many live examples |
Motivation
Support deprecation information in Config. Users can add a field
_deprecation_
into a config file, which will trigger a deprecation warning during callingConfig.fromfile
. Optionally, the warning information can include a path to the expected config file to replace the deprecated one.Modification
config.py
Use cases (Optional)
For example, if a config file
old_config.py
has been renamed tonew_config.py
. To avoid bc-breaking, we can create anold_config.py
file with deprecation information as following: