Pros:
- Less duplication
- Sphinx shows methods docstring on the client API as well
Cons:
- Some Python magic
- Won't play well with static analysis tools.
Depends on D507
Differential D505
Autogenerate the Indexer Storage HTTP API. vlorentz on Oct 5 2018, 6:25 PM. Authored by
Details
Diff Detail
Event TimelineThis comment was removed by vlorentz. Comment Actions I'm not sure I'm a huge fan of some of the hacks required (removing the cur/self/... arguments), but on the purely technical side this looks very good. The only thing I would question is whether it would be worth it to start directly by factorizing that in the RPC itself, in order to force ourselves finding generic solutions that would work for the rest of the remote APIs? Comment Actions
How else can we avoid this though?
People might as well. Also, tests are fine! So that's a good sign it does what i think it does. I don't think it's clear to me what happens during import and the implications here (since we run code here to declare methods/functions/class, instead of simply declaring those). In that regard, that might be a clue to push further below that kind of code...
... (as seirl hinted at)... Cheers,
Comment Actions Indeed. I just moved all the code to swh.core.api and it looks even nicer this way (no need to put the for loop at the root of a module). I'll write a Diff later today. Comment Actions In this current state, i have errors on make test, the base of which seems to be this: TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases steps to reproduce: cd swh-core arc patch D507 cd ../swh-indexer arc patch D505 make test |