contrib/check-pytype.sh
author Matt Harbison <matt_harbison@yahoo.com>
Wed, 04 Jan 2023 17:15:19 -0500
changeset 49847 31bbf7a28a75
parent 49796 98e7be1ed6c5
child 49868 a8893ec94a08
permissions -rwxr-xr-x
pytype: add coverage for hgdemandimport This would have flagged what needed fixing in 48e38b179106 long ago.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49501
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
     1
#!/bin/sh
46898
e1d75c514ced tests: add a (very slow) test that executes pytype
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
     2
49501
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
     3
set -e
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
     4
set -u
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
     5
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
     6
cd `hg root`
46898
e1d75c514ced tests: add a (very slow) test that executes pytype
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
     7
49501
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
     8
# Many of the individual files that are excluded here confuse pytype
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
     9
# because they do a mix of Python 2 and Python 3 things
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    10
# conditionally. There's no good way to help it out with that as far as
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    11
# I can tell, so let's just hide those files from it for now. We should
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    12
# endeavor to empty this list out over time, as some of these are
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    13
# probably hiding real problems.
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    14
#
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    15
# mercurial/bundlerepo.py       # no vfs and ui attrs on bundlerepo
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    16
# mercurial/context.py          # many [attribute-error]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    17
# mercurial/crecord.py          # tons of [attribute-error], [module-attr]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    18
# mercurial/debugcommands.py    # [wrong-arg-types]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    19
# mercurial/dispatch.py         # initstdio: No attribute ... on TextIO [attribute-error]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    20
# mercurial/exchange.py         # [attribute-error]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    21
# mercurial/hgweb/hgweb_mod.py  # [attribute-error], [name-error], [wrong-arg-types]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    22
# mercurial/hgweb/server.py     # [attribute-error], [name-error], [module-attr]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    23
# mercurial/hgweb/wsgicgi.py    # confused values in os.environ
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    24
# mercurial/httppeer.py         # [attribute-error], [wrong-arg-types]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    25
# mercurial/interfaces          # No attribute 'capabilities' on peer [attribute-error]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    26
# mercurial/keepalive.py        # [attribute-error]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    27
# mercurial/localrepo.py        # [attribute-error]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    28
# mercurial/manifest.py         # [unsupported-operands], [wrong-arg-types]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    29
# mercurial/minirst.py          # [unsupported-operands], [attribute-error]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    30
# mercurial/pure/osutil.py      # [invalid-typevar], [not-callable]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    31
# mercurial/pure/parsers.py     # [attribute-error]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    32
# mercurial/repoview.py         # [attribute-error]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    33
# mercurial/testing/storage.py  # tons of [attribute-error]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    34
# mercurial/unionrepo.py        # ui, svfs, unfiltered [attribute-error]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    35
# mercurial/win32.py            # [not-callable]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    36
# mercurial/wireprotoframing.py # [unsupported-operands], [attribute-error], [import-error]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    37
# mercurial/wireprotov1peer.py  # [attribute-error]
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    38
# mercurial/wireprotov1server.py  # BUG?: BundleValueError handler accesses subclass's attrs
46898
e1d75c514ced tests: add a (very slow) test that executes pytype
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    39
49501
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    40
# TODO: use --no-cache on test server?  Caching the files locally helps during
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    41
#       development, but may be a hinderance for CI testing.
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    42
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    43
# TODO: include hgext and hgext3rd
46898
e1d75c514ced tests: add a (very slow) test that executes pytype
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    44
49847
31bbf7a28a75 pytype: add coverage for hgdemandimport
Matt Harbison <matt_harbison@yahoo.com>
parents: 49796
diff changeset
    45
pytype -V 3.7 --keep-going --jobs auto doc/check-seclevel.py hgdemandimport mercurial \
49501
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    46
    -x mercurial/bundlerepo.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    47
    -x mercurial/context.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    48
    -x mercurial/crecord.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    49
    -x mercurial/debugcommands.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    50
    -x mercurial/dispatch.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    51
    -x mercurial/exchange.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    52
    -x mercurial/hgweb/hgweb_mod.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    53
    -x mercurial/hgweb/server.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    54
    -x mercurial/hgweb/wsgicgi.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    55
    -x mercurial/httppeer.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    56
    -x mercurial/interfaces \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    57
    -x mercurial/keepalive.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    58
    -x mercurial/localrepo.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    59
    -x mercurial/manifest.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    60
    -x mercurial/minirst.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    61
    -x mercurial/pure/osutil.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    62
    -x mercurial/pure/parsers.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    63
    -x mercurial/repoview.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    64
    -x mercurial/testing/storage.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    65
    -x mercurial/thirdparty \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    66
    -x mercurial/unionrepo.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    67
    -x mercurial/win32.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    68
    -x mercurial/wireprotoframing.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    69
    -x mercurial/wireprotov1peer.py \
08c3ecd899ae tests: migrate the pytype test to a shell script for easier CI processing
Matt Harbison <matt_harbison@yahoo.com>
parents: 49019
diff changeset
    70
    -x mercurial/wireprotov1server.py
49651
3e1869751cfe contrib: update check-pytype.sh to list stubs that caused pytype to crash
Matt Harbison <matt_harbison@yahoo.com>
parents: 49501
diff changeset
    71
3e1869751cfe contrib: update check-pytype.sh to list stubs that caused pytype to crash
Matt Harbison <matt_harbison@yahoo.com>
parents: 49501
diff changeset
    72
echo 'pytype crashed while generating the following type stubs:'
3e1869751cfe contrib: update check-pytype.sh to list stubs that caused pytype to crash
Matt Harbison <matt_harbison@yahoo.com>
parents: 49501
diff changeset
    73
find .pytype/pyi -name '*.pyi' | xargs grep -l '# Caught error' | sort