Skip to content

Commit 058e451

Browse files
committed
[p] Adopt mypy (#6821, PR #6854)
2 parents 8aa14db + 616bbd4 commit 058e451

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+588
-388
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,12 @@ jobs:
138138
cache: 'pip'
139139
cache-dependency-path: 'requirements.dev.txt'
140140

141-
- uses: 'github/codeql-action/init@v2'
141+
- uses: 'github/codeql-action/init@v3'
142142
with:
143143
languages: '${{ matrix.language }}'
144-
setup-python-dependencies: false
145144
config-file: './.github/codeql/codeql-config.yml'
146145
queries: 'security-and-quality'
147146

148-
- uses: 'github/codeql-action/analyze@v2'
147+
- uses: 'github/codeql-action/analyze@v3'
149148
with:
150149
category: '/language:${{matrix.language}}'

.mypy.ini

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,24 @@ modules =
1111
azul.azulclient,
1212
azul.bytes,
1313
azul.caching,
14-
azul.chalice
14+
azul.chalice,
15+
azul.bigquery,
16+
azul.bigquery_reservation,
17+
azul.csp,
18+
azul.deployment,
19+
azul.strings,
20+
azul.logging,
21+
azul,
22+
azul.docker
1523
packages =
1624
azul.openapi
1725

1826
[mypy-furl.*]
1927
follow_untyped_imports = True
2028

2129
[mypy-requests.*]
22-
follow_untyped_imports = True
30+
follow_untyped_imports = True
31+
32+
[mypy-docker.*]
33+
; https://github.com/python/typeshed/issues/13439
34+
follow_untyped_imports = True

CONTRIBUTING.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,12 @@ Ordering artifacts in the source
397397
Disabling sections of code
398398
--------------------------
399399

400-
* To temporarily disable a section of code, we embed it in a conditional
401-
statement with an test that always evaluates to false (``if False:`` in
402-
Python) instead of commenting that section out. We do this to keep the code
403-
subject to refactorings and code inspection tools.
400+
* We do not comment out sections of code. To temporarily disable some section of
401+
code, we embed it in a conditional statement with a test that always evaluates
402+
to ``False``. We do this to keep the code subject to refactorings and type
403+
checkers. We use ``azul.false()`` instead of just the ``False`` literal, in
404+
order to avoid the detection of unreachable code during static analysis by
405+
PyCharm and CodeQL.
404406

405407
Control flow
406408
------------
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)