fune/python
Ricky Stewart 31755b431d Bug 1657650 - Require that Mach command providers subclass MachCommandBase. r=remote-protocol-reviewers,marionette-reviewers,maja_zf,mhentges,froydnj
Today we don't require that `mach` `CommandProvider`s subclass from any particular parent class and we're very lax about the requirements they must meet. While that's convenient in certain circumstances, it has some unfortunate implications for feature development.

Today the only requirements that we have for `CommandProvider`s are that they have an `__init__()` method that takes either 1 or 2 arguments, the second of which must be called `context` and is populated with the `mach` `CommandContext`. Again, while this flexibility is occasionally convenient, it is limiting. As we add features to `mach`, having a better idea what the shape of our `CommandProvider`s are and how we can instantiate them and use them is increasingly important, and this gives us additional control when having `mach` configure `CommandProvider`s based on data that is only available at the `mach` level. In particular, we plan to leverage this in bugs 985141 and 1654074.

Here we add validation to the `CommandProvider` decorator to ensure all classes inherit from `MachCommandBase`, update all `CommandProvider`s in-tree to inherit from `MachCommandBase`, and update source and test code accordingly.

Follow-up work: we now require (de facto) that the `context` be populated with a `topdir` attribute by the `populate_context_handler` function, since instantiating the `MachCommandBase` requires a `topdir` be provided. This is fine for now in the interest of keeping this patch reasonably sized, but some additional refactoring could make this cleaner.

Differential Revision: https://phabricator.services.mozilla.com/D86255
2020-08-07 18:24:59 +00:00
..
devtools/migrate-l10n
docs
gdbpp/gdbpp Bug 1622868 - Fix ns*String pretty-printers, r=glandium 2020-03-17 04:51:21 +00:00
l10n Bug 1654177 - Remove Fluent migration recipes for Firefox 78, r=Pike 2020-07-23 08:03:48 +00:00
lldbutils Bug 1637130 - Rename visual overflow to ink overflow. r=dbaron 2020-07-20 20:17:36 +00:00
mach Bug 1657650 - Require that Mach command providers subclass MachCommandBase. r=remote-protocol-reviewers,marionette-reviewers,maja_zf,mhentges,froydnj 2020-08-07 18:24:59 +00:00
mozboot Bug 1657650 - Require that Mach command providers subclass MachCommandBase. r=remote-protocol-reviewers,marionette-reviewers,maja_zf,mhentges,froydnj 2020-08-07 18:24:59 +00:00
mozbuild Bug 1657650 - Require that Mach command providers subclass MachCommandBase. r=remote-protocol-reviewers,marionette-reviewers,maja_zf,mhentges,froydnj 2020-08-07 18:24:59 +00:00
mozlint Bug 1657604 - [mozlint] Support multiple linters per yaml file, r=linter-reviewers,sylvestre 2020-08-07 07:12:41 +00:00
mozperftest Bug 1537763 - [mozproxy] Add a record mode; r=tarek 2020-08-05 19:43:55 +00:00
mozrelease Bug 1653662: [mozrelease] Update mozrelease subcommands to python 3; r=aki 2020-07-18 01:36:36 +00:00
mozterm
mozversioncontrol Bug 1645196: Tune git settings to improve performance r=rstewart 2020-07-10 12:54:24 +00:00
safety Bug 1656611 - Remove objdir support from virtualenv_packages.txt handling r=mhentges,froydnj 2020-08-07 16:03:36 +00:00
mach_commands.py Bug 1656611 - Remove objdir support from virtualenv_packages.txt handling r=mhentges,froydnj 2020-08-07 16:03:36 +00:00
moz.build Bug 925350 - Remove dumbmake r=nalexander 2020-07-10 18:12:07 +00:00
README

This directory contains common Python code.

The basic rule is that if Python code is cross-module (that's "module" in the
Mozilla meaning - as in "module ownership") and is MPL-compatible, it should
go here.

What should not go here:

* Vendored python modules (use third_party/python instead)
* Python that is not MPL-compatible (see other-licenses/)
* Python that has good reason to remain close to its "owning" (Mozilla)
  module (e.g. it is only being consumed from there).

Historical information can be found at
https://bugzilla.mozilla.org/show_bug.cgi?id=775243
https://bugzilla.mozilla.org/show_bug.cgi?id=1346025