##// END OF EJS Templates
tests: enforce the use of `from __future__ import annotations`...
Matt Harbison -
r53246:662b08ac default
parent child Browse files
Show More
@@ -1,45 +1,52
1 1 #require test-repo hg32
2 2
3 3 $ . "$TESTDIR/helpers-testrepo.sh"
4 4 $ import_checker="$TESTDIR"/../contrib/import-checker.py
5 5
6 6 $ cd "$TESTDIR"/..
7 7
8 8 There are a handful of cases here that require renaming a module so it
9 9 doesn't overlap with a stdlib module name. There are also some cycles
10 10 here that we should still endeavor to fix, and some cycles will be
11 11 hidden by deduplication algorithm in the cycle detector, so fixing
12 12 these may expose other cycles.
13 13
14 14 Known-bad files are excluded by -X as some of them would produce unstable
15 15 outputs, which should be fixed later.
16 16
17 17 NOTE: the `hg files` command here only works on files that are known to
18 18 Mercurial. If you add an import of a new file and haven't yet `hg add`ed it, you
19 19 will likely receive warnings about a direct import.
20 20
21 21 $ testrepohg files 'set:**.py or grep(r"^#!.*?python")' \
22 22 > 'glob:tests/**.t' \
23 23 > -X hgweb.cgi \
24 24 > -X setup.py \
25 25 > -X contrib/automation/ \
26 26 > -X contrib/debugshell.py \
27 27 > -X contrib/hgweb.fcgi \
28 28 > -X contrib/packaging/hg-docker \
29 29 > -X contrib/packaging/hgpackaging/ \
30 30 > -X contrib/packaging/inno/ \
31 31 > -X contrib/phab-clean.py \
32 32 > -X contrib/python-zstandard/ \
33 33 > -X contrib/win32/hgwebdir_wsgi.py \
34 34 > -X contrib/perf-utils/perf-revlog-write-plot.py \
35 35 > -X doc/gendoc.py \
36 36 > -X doc/hgmanpage.py \
37 37 > -X i18n/posplit \
38 38 > -X mercurial/thirdparty \
39 39 > -X tests/hypothesishelpers.py \
40 40 > -X tests/test-check-interfaces.py \
41 41 > -X tests/test-demandimport.py \
42 42 > -X tests/test-imports-checker.t \
43 43 > -X tests/test-verify-repo-operations.py \
44 44 > -X tests/test-extension.t \
45 45 > | sed 's-\\-/-g' | "$PYTHON" "$import_checker" -
46
47 All files that get type checked must have 'from __future__ import annotations'
48
49 $ testrepohg files 'set:**.py and size(">0")' -I mercurial -I hgext -X mercurial/thirdparty -0 \
50 > | xargs -0 grep -L '^from __future__ import annotations$'
51 mercurial/cmd_impls/graft.py
52 mercurial/testing/ps_util.py
General Comments 0
You need to be logged in to leave comments. Login now