This is an archive of the discontinued Mercurial Phabricator instance.

infinitepush: use zope.interface to define indexapi interface
Needs RevisionPublic

Authored by pulkit on Mar 31 2018, 7:54 AM.

Details

Reviewers
indygreg
Group Reviewers
hg-reviewers
Summary

This patch makes indexapi use zope.interface which is now vendored with
mercurial.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit created this revision.Mar 31 2018, 7:54 AM
indygreg requested changes to this revision.Mar 31 2018, 1:22 PM
indygreg added a subscriber: indygreg.

Please also add test coverage to test-check-interfaces.py, otherwise these interfaces mean practically nothing. zope.interface doesn't perform run-time interface conformance tests unless you explicitly instruct it to. For now, we're going to verify interfaces in test-check-interfaces.py.

hgext/infinitepush/indexapi.py
25

Interface classes don't define self on methods. So please drop self from all these methods.

This revision now requires changes to proceed.Mar 31 2018, 1:22 PM

Oh, when you add test coverage, watch out for mysql.connector being unavailable. You may want to register a fake module in sys.modules['mysql.connector'] to ensure it always is available.