Mercurial > public > mercurial-scm > hg
diff contrib/import-checker.py @ 52443:0cc50d9ac6b0
tests: drop references to the vendored copy of `zope`
The `test-check-interfaces.py` test has mostly been a no-op since ef7d85089952.
Somehow, checks are still done on mere imports, as these errors were seen when
subclassing `Protocol` and adding the `self` argument to the repository
interfaces. So just get rid of it.
--- /builds/mercurial-ci/tests/test-check-interfaces.py.out
+++ /builds/mercurial-ci/tests/test-check-interfaces.py.err
@@ -0,0 +1,16 @@
+Traceback (most recent call last):
+ File "/builds/mercurial-ci/tests/test-check-interfaces.py", line 12, in <module>
+ from mercurial.interfaces import (
+ File "/tmp/hgtests.hl7bqyl0/install/lib/python/mercurial/interfaces/repository.py", line 401, in <module>
+ @interfaceutil.implementer(ipeerbase)
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "/tmp/hgtests.hl7bqyl0/install/lib/python/mercurial/thirdparty/zope/interface/declarations.py", line 388, in __call__
+ classImplements(ob, *self.interfaces)
+ File "/tmp/hgtests.hl7bqyl0/install/lib/python/mercurial/thirdparty/zope/interface/declarations.py", line 327, in classImplements
+ spec.declared += tuple(_normalizeargs(interfaces))
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ File "/tmp/hgtests.hl7bqyl0/install/lib/python/mercurial/thirdparty/zope/interface/declarations.py", line 910, in _normalizeargs
+ _normalizeargs(v, output)
+ File "/tmp/hgtests.hl7bqyl0/install/lib/python/mercurial/thirdparty/zope/interface/declarations.py", line 909, in _normalizeargs
+ for v in sequence:
+TypeError: '_ProtocolMeta' object is not iterable
ERROR: test-check-interfaces.py output changed
Additionally, as will be seen in the next commit, the fact that this code is
imported at all has an influence on pytype checking, even when it shouldn't be
getting used. Any replacement test will likely be a python file that
instantiates things and tries to assign them to variables annotated with a
Protocol, and is then checked with pytype. But in the meantime, the explicit
subclassing of the Protocol classes will give us some coverage.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 07 Dec 2024 03:07:04 -0500 |
parents | 3ba998d7fc77 |
children | e627cc25b6f3 |
line wrap: on
line diff
--- a/contrib/import-checker.py Wed Dec 04 15:05:56 2024 +0100 +++ b/contrib/import-checker.py Sat Dec 07 03:07:04 2024 -0500 @@ -43,8 +43,6 @@ 'mercurial.thirdparty.attr', 'mercurial.thirdparty.jaraco.collections', 'mercurial.thirdparty.tomli', - 'mercurial.thirdparty.zope', - 'mercurial.thirdparty.zope.interface', 'typing', 'xml.etree.ElementTree', )