Mercurial > public > mercurial-scm > hg
comparison mercurial/pure/parsers.py @ 51725:278af66e6595
typing: induce pytype to use the standard `attr` instead of the vendored copy
What was previously happening with the vendored copy was that pytype would stub
out all(?) classes that were decorated with `@attr.s` as `Any`. After this, we
get a ton of classes defined, and numerous fields and methods now have proper
types.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 23 Jul 2024 19:20:22 -0400 |
parents | ca7bde5dbafb |
children | d748fd2647f8 |
comparison
equal
deleted
inserted
replaced
51724:2e9e62242451 | 51725:278af66e6595 |
---|---|
7 | 7 |
8 | 8 |
9 import io | 9 import io |
10 import stat | 10 import stat |
11 import struct | 11 import struct |
12 import typing | |
12 import zlib | 13 import zlib |
13 | 14 |
14 from ..node import ( | 15 from ..node import ( |
15 nullrev, | 16 nullrev, |
16 sha1nodeconstants, | 17 sha1nodeconstants, |
17 ) | 18 ) |
18 from ..thirdparty import attr | 19 from ..thirdparty import attr |
20 | |
21 # Force pytype to use the non-vendored package | |
22 if typing.TYPE_CHECKING: | |
23 # noinspection PyPackageRequirements | |
24 import attr | |
25 | |
19 from .. import ( | 26 from .. import ( |
20 error, | 27 error, |
21 revlogutils, | 28 revlogutils, |
22 util, | 29 util, |
23 ) | 30 ) |