comparison mercurial/store.py @ 51729: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 2e9e62242451
children 0338fb200a30
comparison
equal deleted inserted replaced
51728:2e9e62242451 51729:278af66e6595
8 import collections 8 import collections
9 import functools 9 import functools
10 import os 10 import os
11 import re 11 import re
12 import stat 12 import stat
13 import typing
14
13 from typing import Generator, List 15 from typing import Generator, List
14 16
15 from .i18n import _ 17 from .i18n import _
16 from .thirdparty import attr 18 from .thirdparty import attr
19
20 # Force pytype to use the non-vendored package
21 if typing.TYPE_CHECKING:
22 # noinspection PyPackageRequirements
23 import attr
24
17 from .node import hex 25 from .node import hex
18 from .revlogutils.constants import ( 26 from .revlogutils.constants import (
19 INDEX_HEADER, 27 INDEX_HEADER,
20 KIND_CHANGELOG, 28 KIND_CHANGELOG,
21 KIND_FILELOG, 29 KIND_FILELOG,