[openstack-dev] [oslo][glance][all] Removing deprecated functions from oslo_utils.timeutils
Sean Dague
sean at dague.net
Thu Dec 10 13:26:43 UTC 2015
On 12/10/2015 01:56 AM, Joshua Harlow wrote:
> Shouldn't be to hard (although it's probably not on each oslo project,
> but on the consumers projects).
>
> The warnings module can turn warnings into raised exceptions with a
> simple command line switch btw...
>
> For example:
>
> $ python -Wonce
> Python 2.7.6 (default, Jun 22 2015, 17:58:13)
> [GCC 4.8.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import warnings
>>>> warnings.warn("I am not supposed to be used", DeprecationWarning)
> __main__:1: DeprecationWarning: I am not supposed to be used
>
> $ python -Werror
> Python 2.7.6 (default, Jun 22 2015, 17:58:13)
> [GCC 4.8.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import warnings
>>>> warnings.warn("I am not supposed to be used", DeprecationWarning)
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> DeprecationWarning: I am not supposed to be used
>
> https://docs.python.org/2/library/warnings.html#the-warnings-filter
>
> Turn that CLI switch from off to on and I'm pretty sure usage of
> deprecated things will become pretty evident real quick ;)
It needs to be more targetted than that. There is a long standing
warning between paste and pkg_resources that would hard stop everyone.
But, yes, the idea of being able to run unit tests with fatal
deprecations of oslo easily is what I think would be useful.
-Sean
--
Sean Dague
http://dague.net
More information about the OpenStack-dev
mailing list