Mark proxy properties on scmtools.models.Tool as deprecated.
Review Request #12331 — Created June 3, 2022 and submitted
The Tool model has a handful of properties which proxy things which
are provided by the SCMTool subclass. This was used a long time ago to
make it easier to render things in templates (since trying to access the
class in the template would end up instantiating it). We haven't used
templates for this stuff in a long time, and all our code accesses these
via thescmtool_class
property rather than these proxies.This change adds a wrapper which will raise a deprecation warning if any
of these properties are accessed via the tool.
- Opened a shell, enabled all warnings, and then accessed properties via
the tool instance. Saw that I got the correct results, and that the
deprecation warning was raised. - Ran unit tests.
Summary | ID |
---|---|
2be21b1f7fefb87908fad246f7abe6d5947dc0ff |
Description | From | Last Updated |
---|---|---|
I've landed my deprecation updates change, so this can go. |
chipx86 | |
Can you add a Version Added? |
chipx86 | |
We should probably use functools.wraps to ensure all the function attributes are set right. |
chipx86 | |
You don't need warnings anymore. You can just call RemovedInReviewBoard60Warning.warn(...) with the string. |
chipx86 |
- Commits:
-
Summary ID 704086ea09abf6f4493d0cb489e433ff52d6fa7a 2be21b1f7fefb87908fad246f7abe6d5947dc0ff - Diff:
-
Revision 2 (+74 -16)