-
Notifications
You must be signed in to change notification settings - Fork 148
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
Deprecate private functions #234
Conversation
89d9234
to
2d4f206
Compare
Any idea why the warning on Would be nice to get this released soon, the Python 3.6 EOL is around the corner and dropping it will bring a major version bump (see #239), and would be a good time to bundle in removal of these deprecations too. Thanks! |
Prior to this change, the `Unit` enum and the `abs_timedelta` and `date_and_delta` functions were listed as public functions in the documentation but were not available from the root package: >>> import humanize >>> humanize.Unit Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'humanize' has no attribute 'Unit' >>> humanize.abs_timedelta Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'humanize' has no attribute 'abs_timedelta' This change makes these members private. In order to preserve backwards compatibility after this change, we provide aliases for these members which emit deprecation warnings.
Prior to this change, the `Unit` enum and the `abs_timedelta` and `date_and_delta` functions were listed as public functions in the documentation but were not available from the root package: >>> import humanize >>> humanize.gettext Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'humanize' has no attribute 'gettext' >>> humanize.ngettext Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'humanize' has no attribute 'ngettext' This change makes these members private. In order to preserve backwards compatibility after this change, we provide aliases for these members which emit deprecation warnings.
2d4f206
to
2fdcdb3
Compare
The test run locally now, so I've pushed up the change. |
Codecov Report
@@ Coverage Diff @@
## master #234 +/- ##
==========================================
- Coverage 99.68% 97.01% -2.68%
==========================================
Files 9 9
Lines 635 670 +35
==========================================
+ Hits 633 650 +17
- Misses 2 20 +18
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Thank you! I'll release this later today, and then the next version will likely be a major bump (with #239) so feel free to create a removal PR whenever suits you! |
These functions (and the enum) are listed on the documentation but are not available from the root
humanize
package.This change makes the private functions private by prepending their names with an underscore. In order to make this change backwards compatible, we provide aliases for the functions under the old names. These aliases will emit deprecation warnings if called. The aliases are removed in samueljsb#1.
This fixes #225.