Skip to content

Commit f1d0d91

Browse files
committed
.
1 parent 1d8fdb5 commit f1d0d91

File tree

2 files changed

+43
-23
lines changed

2 files changed

+43
-23
lines changed

CHANGELOG.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,16 @@ garbage collector.
99

1010
Contributed by Jukka Lehtosalo (PR [18306](https://github.com/python/mypy/pull/18306)).
1111

12-
### Drop Support for Python 3.8
13-
14-
Mypy no longer supports running with Python 3.8, which has reached end-of-life.
15-
When running mypy with Python 3.9+, it is still possible to type check code
16-
that needs to support Python 3.8 with the `--python-version 3.8` argument.
17-
Support for this will be dropped in the first half of 2025!
18-
19-
Contributed by Marc Mueller (PR [17492](https://github.com/python/mypy/pull/17492)).
20-
2112
### Mypyc accelerated mypy wheels for aarch64
2213

2314
Mypy can compile itself to C extension modules using mypyc. This makes mypy 3-5x faster
2415
than if mypy is interpreted with pure Python. We now build and upload mypyc accelerated
2516
mypy wheels for `manylinux_aarch64` to PyPI, making it easy for users on such platforms
2617
to realise this speedup.
2718

28-
Contributed by Christian Bundy (PR [mypy_mypyc-wheels#76](https://github.com/mypyc/mypy_mypyc-wheels/pull/76))
19+
Contributed by Christian Bundy and Marc Mueller
20+
(PR [mypy_mypyc-wheels#76](https://github.com/mypyc/mypy_mypyc-wheels/pull/76),
21+
PR [mypy_mypyc-wheels#89](https://github.com/mypyc/mypy_mypyc-wheels/pull/89)).
2922

3023
### `--strict-bytes`
3124

@@ -48,6 +41,16 @@ Contributed by Christoph Tyralla (PR [18180](https://github.com/python/mypy/pull
4841
(Speaking of partial types, another reminder that mypy plans on enabling `--local-partial-types`
4942
by default in **mypy 2.0**).
5043

44+
### Better discovery of configuration files
45+
46+
Mypy will now walk up the filesystem (up until a repository or file system root) to discover
47+
configuration files. See the
48+
[mypy configuration file documentation](https://mypy.readthedocs.io/en/stable/config_file.html)
49+
for more details.
50+
51+
Contributed by Mikhail Shiryaev and Shantanu Jain
52+
(PR [16965](https://github.com/python/mypy/pull/16965), PR [18482](https://github.com/python/mypy/pull/18482)
53+
5154
### Better line numbers for decorators and slice expressions
5255

5356
Mypy now uses more correct line numbers for decorators and slice expressions. In some cases, this
@@ -56,6 +59,15 @@ may necessitate changing the location of a `# type: ignore` comment.
5659
Contributed by Shantanu Jain (PR [18392](https://github.com/python/mypy/pull/18392),
5760
PR [18397](https://github.com/python/mypy/pull/18397)).
5861

62+
### Drop Support for Python 3.8
63+
64+
Mypy no longer supports running with Python 3.8, which has reached end-of-life.
65+
When running mypy with Python 3.9+, it is still possible to type check code
66+
that needs to support Python 3.8 with the `--python-version 3.8` argument.
67+
Support for this will be dropped in the first half of 2025!
68+
69+
Contributed by Marc Mueller (PR [17492](https://github.com/python/mypy/pull/17492)).
70+
5971
## Mypy 1.14
6072

6173
We’ve just uploaded mypy 1.14 to the Python Package Index ([PyPI](https://pypi.org/project/mypy/)).

docs/source/config_file.rst

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,30 @@ Mypy is very configurable. This is most useful when introducing typing to
77
an existing codebase. See :ref:`existing-code` for concrete advice for
88
that situation.
99

10-
Mypy supports reading configuration settings from a file with the following precedence order:
10+
Mypy supports reading configuration settings from a file. By default, mypy will
11+
discover configuration files by walking up the file system (up until the root of
12+
a repository or the root of the filesystem). In each directory, it will look for
13+
the following configuration files (in this order):
1114

12-
1. ``./mypy.ini``
13-
2. ``./.mypy.ini``
14-
3. ``./pyproject.toml``
15-
4. ``./setup.cfg``
16-
5. ``$XDG_CONFIG_HOME/mypy/config``
17-
6. ``~/.config/mypy/config``
18-
7. ``~/.mypy.ini``
15+
1. ``mypy.ini``
16+
2. ``.mypy.ini``
17+
3. ``pyproject.toml`` (containing a ``[tool.mypy]`` section)
18+
4. ``setup.cfg`` (containing a ``[mypy]`` section)
19+
20+
If no configuration file is found by this method, mypy will then look for
21+
configuration files in the following locations (in this order):
22+
23+
1. ``$XDG_CONFIG_HOME/mypy/config``
24+
2. ``~/.config/mypy/config``
25+
3. ``~/.mypy.ini``
26+
27+
The :option:`--config-file <mypy --config-file>` command-line flag has the
28+
highest precedence and must be point towards a valid configuration file;
29+
otherwise mypy will report an error and exit. Without the command line option,
30+
mypy will look for configuration files in the precedence order above.
1931

2032
It is important to understand that there is no merging of configuration
21-
files, as it would lead to ambiguity. The :option:`--config-file <mypy --config-file>`
22-
command-line flag has the highest precedence and
23-
must be correct; otherwise mypy will report an error and exit. Without the
24-
command line option, mypy will look for configuration files in the
25-
precedence order above.
33+
files, as it would lead to ambiguity.
2634

2735
Most flags correspond closely to :ref:`command-line flags
2836
<command-line>` but there are some differences in flag names and some

0 commit comments

Comments
 (0)