Skip to content

Commit 84d87cb

Browse files
committed
Merge remote-tracking branch 'origin/master' into f/typeform4
2 parents f191c95 + b266dd1 commit 84d87cb

File tree

458 files changed

+23346
-7176
lines changed

Some content is hidden

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

458 files changed

+23346
-7176
lines changed

.github/workflows/docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
# so it's important to do the docs build on all PRs touching mypy/errorcodes.py
1313
# in case somebody's adding a new error code without any docs
1414
- 'mypy/errorcodes.py'
15+
# Part of the documentation is automatically generated from the options
16+
# definitions in mypy/main.py
17+
- 'mypy/main.py'
1518
- 'mypyc/doc/**'
1619
- '**/*.rst'
1720
- '**/*.md'

.github/workflows/mypy_primer.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
6767
--debug \
6868
--additional-flags="--debug-serialize" \
6969
--output concise \
70+
--mypy-install-librt \
7071
| tee diff_${{ matrix.shard-index }}.txt
7172
) || [ $? -eq 1 ]
7273
- if: ${{ matrix.shard-index == 0 }}

.github/workflows/test.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,25 @@ jobs:
5959
toxenv: py
6060
tox_extra_args: "-n 4"
6161
test_mypyc: true
62-
- name: Test suite with py313-windows-64
63-
python: '3.13'
64-
os: windows-latest
65-
toxenv: py
66-
tox_extra_args: "-n 4"
67-
68-
- name: Test suite with py314-dev-ubuntu
69-
python: '3.14-dev'
62+
- name: Test suite with py314-ubuntu, mypyc-compiled
63+
python: '3.14'
7064
os: ubuntu-24.04-arm
7165
toxenv: py
7266
tox_extra_args: "-n 4"
73-
# allow_failure: true
7467
test_mypyc: true
68+
- name: Test suite with py314-windows-64
69+
python: '3.14'
70+
os: windows-latest
71+
toxenv: py
72+
tox_extra_args: "-n 4"
73+
74+
# - name: Test suite with py315-dev-ubuntu
75+
# python: '3.15-dev'
76+
# os: ubuntu-24.04-arm
77+
# toxenv: py
78+
# tox_extra_args: "-n 4"
79+
# # allow_failure: true
80+
# test_mypyc: true
7581

7682
- name: mypyc runtime tests with py39-macos
7783
python: '3.9.21'

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ repos:
4141
# actionlint has a shellcheck integration which extracts shell scripts in `run:` steps from GitHub Actions
4242
# and checks these with shellcheck. This is arguably its most useful feature,
4343
# but the integration only works if shellcheck is installed
44-
- "github.com/wasilibs/go-shellcheck/cmd/shellcheck@v0.10.0"
44+
- "github.com/wasilibs/go-shellcheck/cmd/shellcheck@v0.11.1"
4545
- repo: https://github.com/woodruffw/zizmor-pre-commit
4646
rev: v1.5.2
4747
hooks:

CHANGELOG.md

Lines changed: 322 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ Mypy can be integrated into popular IDEs:
142142
- Emacs: using [Flycheck](https://github.com/flycheck/)
143143
- Sublime Text: [SublimeLinter-contrib-mypy](https://github.com/fredcallaway/SublimeLinter-contrib-mypy)
144144
- PyCharm: [mypy plugin](https://github.com/dropbox/mypy-PyCharm-plugin)
145+
- IDLE: [idlemypyextension](https://github.com/CoolCat467/idlemypyextension)
145146
- pre-commit: use [pre-commit mirrors-mypy](https://github.com/pre-commit/mirrors-mypy), although
146147
note by default this will limit mypy's ability to analyse your third party dependencies.
147148

docs/requirements-docs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
-r ../mypy-requirements.txt
12
sphinx>=8.1.0
23
furo>=2022.3.4
34
myst-parser>=4.0.0

docs/source/command_line.rst

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ definitions or calls.
372372

373373
.. option:: --untyped-calls-exclude
374374

375-
This flag allows to selectively disable :option:`--disallow-untyped-calls`
375+
This flag allows one to selectively disable :option:`--disallow-untyped-calls`
376376
for functions and methods defined in specific packages, modules, or classes.
377377
Note that each exclude entry acts as a prefix. For example (assuming there
378378
are no type annotations for ``third_party_lib`` available):
@@ -562,7 +562,7 @@ potentially problematic or redundant in some way.
562562

563563
.. option:: --deprecated-calls-exclude
564564

565-
This flag allows to selectively disable :ref:`deprecated<code-deprecated>` warnings
565+
This flag allows one to selectively disable :ref:`deprecated<code-deprecated>` warnings
566566
for functions and methods defined in specific packages, modules, or classes.
567567
Note that each exclude entry acts as a prefix. For example (assuming ``foo.A.func`` is deprecated):
568568

@@ -728,9 +728,22 @@ of the above sections.
728728
if text != b'other bytes': # Error: non-overlapping equality check!
729729
...
730730
731-
assert text is not None # OK, check against None is allowed as a special case.
731+
assert text is not None # OK, check against None is allowed
732732
733733
734+
.. option:: --strict-equality-for-none
735+
736+
This flag extends :option:`--strict-equality <mypy --strict-equality>` for checks
737+
against ``None``:
738+
739+
.. code-block:: python
740+
741+
text: str
742+
assert text is not None # Error: non-overlapping identity check!
743+
744+
Note that :option:`--strict-equality-for-none <mypy --strict-equality-for-none>`
745+
only works in combination with :option:`--strict-equality <mypy --strict-equality>`.
746+
734747
.. option:: --strict-bytes
735748

736749
By default, mypy treats ``bytearray`` and ``memoryview`` as subtypes of ``bytes`` which
@@ -1242,12 +1255,18 @@ Miscellaneous
12421255
stub packages were found, they are installed and then another run
12431256
is performed.
12441257

1245-
.. option:: --junit-xml JUNIT_XML
1258+
.. option:: --junit-xml JUNIT_XML_OUTPUT_FILE
12461259

12471260
Causes mypy to generate a JUnit XML test result document with
12481261
type checking results. This can make it easier to integrate mypy
12491262
with continuous integration (CI) tools.
12501263

1264+
.. option:: --junit-format {global,per_file}
1265+
1266+
If --junit-xml is set, specifies format.
1267+
global (default): single test with all errors;
1268+
per_file: one test entry per file with failures.
1269+
12511270
.. option:: --find-occurrences CLASS.MEMBER
12521271

12531272
This flag will make mypy print out all usages of a class member

docs/source/common_issues.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ This example demonstrates both safe and unsafe overrides:
731731
732732
class NarrowerReturn(A):
733733
# A more specific return type is fine
734-
def test(self, t: Sequence[int]) -> List[str]: # OK
734+
def test(self, t: Sequence[int]) -> list[str]: # OK
735735
...
736736
737737
class GeneralizedReturn(A):
@@ -746,7 +746,7 @@ not necessary:
746746
.. code-block:: python
747747
748748
class NarrowerArgument(A):
749-
def test(self, t: List[int]) -> Sequence[str]: # type: ignore[override]
749+
def test(self, t: list[int]) -> Sequence[str]: # type: ignore[override]
750750
...
751751
752752
.. _unreachable:

docs/source/config_file.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,15 @@ section of the command line docs.
834834
:default: False
835835

836836
Prohibit equality checks, identity checks, and container checks between
837-
non-overlapping types.
837+
non-overlapping types (except ``None``).
838+
839+
.. confval:: strict_equality_for_none
840+
841+
:type: boolean
842+
:default: False
843+
844+
Include ``None`` in strict equality checks (requires :confval:`strict_equality`
845+
to be activated).
838846

839847
.. confval:: strict_bytes
840848

@@ -1145,6 +1153,15 @@ These options may only be set in the global section (``[mypy]``).
11451153
type checking results. This can make it easier to integrate mypy
11461154
with continuous integration (CI) tools.
11471155

1156+
.. confval:: junit_format
1157+
1158+
:type: string
1159+
:default: ``global``
1160+
1161+
If junit_xml is set, specifies format.
1162+
global (default): single test with all errors;
1163+
per_file: one test entry per file with failures.
1164+
11481165
.. confval:: scripts_are_modules
11491166

11501167
:type: boolean

0 commit comments

Comments
 (0)