Skip to content

Commit c14d68d

Browse files
authored
Merge branch 'master' into release_test
2 parents 4d9a07d + 92a5cbd commit c14d68d

File tree

257 files changed

+18073
-13805
lines changed

Some content is hidden

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

257 files changed

+18073
-13805
lines changed

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
name: Bug Report
3+
about: Submit a bug report
4+
labels: "bug"
5+
---
6+
7+
<!--
8+
If you're new to mypy and you're not sure whether what you're experiencing is a mypy bug, please see the "Question and Help" form
9+
instead.
10+
-->
11+
12+
**Bug Report**
13+
14+
<!--
15+
Note: If the problem you are reporting is about a specific library function, then the typeshed tracker is better suited
16+
for this report: https://github.com/python/typeshed/issues
17+
-->
18+
19+
(A clear and concise description of what the bug is.)
20+
21+
**To Reproduce**
22+
23+
(Write your steps here:)
24+
25+
1. Step 1...
26+
2. Step 2...
27+
3. Step 3...
28+
29+
**Expected Behavior**
30+
31+
<!--
32+
How did you expect your project to behave?
33+
It’s fine if you’re not sure your understanding is correct.
34+
Write down what you thought would happen. If you just expected no errors, you can delete this section.
35+
-->
36+
37+
(Write what you thought would happen.)
38+
39+
**Actual Behavior**
40+
41+
<!--
42+
Did something go wrong?
43+
Is something broken, or not behaving as you expected?
44+
-->
45+
46+
(Write what happened.)
47+
48+
**Your Environment**
49+
50+
<!-- Include as many relevant details about the environment you experienced the bug in -->
51+
52+
- Mypy version used:
53+
- Mypy command-line flags:
54+
- Mypy configuration options from `mypy.ini` (and other config files):
55+
- Python version used:
56+
- Operating system and version:
57+
58+
<!--
59+
You can freely edit this text, please remove all the lines
60+
you believe are unnecessary.
61+
-->

.github/ISSUE_TEMPLATE/crash.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Crash Report
3+
about: Crash (traceback or "INTERNAL ERROR")
4+
labels: "crash"
5+
---
6+
7+
<!--
8+
Use this form only if mypy reports an "INTERNAL ERROR" and/or gives a traceback.
9+
Please include the traceback and all other messages below (use `mypy --show-traceback`).
10+
-->
11+
12+
**Crash Report**
13+
14+
(Tell us what happened.)
15+
16+
**Traceback**
17+
18+
```
19+
(Insert traceback and other messages from mypy here -- use `--show-traceback`.)
20+
```
21+
22+
**To Reproduce**
23+
24+
(Write what you did to reproduce the crash. Full source code is
25+
appreciated. We also very much appreciate it if you try to narrow the
26+
source down to a small stand-alone example.)
27+
28+
**Your Environment**
29+
30+
<!-- Include as many relevant details about the environment you experienced the bug in -->
31+
32+
- Mypy version used:
33+
- Mypy command-line flags:
34+
- Mypy configuration options from `mypy.ini` (and other config files):
35+
- Python version used:
36+
- Operating system and version:
37+
38+
<!--
39+
You can freely edit this text, please remove all the lines
40+
you believe are unnecessary.
41+
-->
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: Documentation
3+
about: Report a problem with the documentation
4+
labels: "documentation"
5+
---
6+
7+
**Documentation**
8+
9+
(A clear and concise description of the issue.)

.github/ISSUE_TEMPLATE/feature.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Feature
3+
about: Submit a proposal for a new mypy feature
4+
labels: "feature"
5+
---
6+
7+
**Feature**
8+
9+
(A clear and concise description of your feature proposal.)
10+
11+
**Pitch**
12+
13+
(Please explain why this feature should be implemented and how it would be used. Add examples, if applicable.)

.github/ISSUE_TEMPLATE/question.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: Questions and Help
3+
about: If you have questions, please check the below links
4+
labels: "question"
5+
---
6+
7+
**Questions and Help**
8+
9+
_Please note that this issue tracker is not a help form and this issue will be closed._
10+
11+
Please check here instead:
12+
13+
- [Website](http://www.mypy-lang.org/)
14+
- [Documentation](https://mypy.readthedocs.io/)
15+
- [Gitter](https://gitter.im/python/typing)

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
### Have you read the [Contributing Guidelines](https://github.com/python/mypy/blob/master/CONTRIBUTING.md)?
2+
3+
(Once you have, delete this section. If you leave it in, your PR may be closed without action.)
4+
5+
### Description
6+
7+
<!--
8+
If this pull request closes or fixes an issue, write Closes #NNN" or "Fixes #NNN" in that exact
9+
format.
10+
-->
11+
12+
(Explain how this PR changes mypy.)
13+
14+
## Test Plan
15+
16+
<!--
17+
If this is a documentation change, rebuild the docs (link to instructions) and review the changed pages for markup errors.
18+
If this is a code change, include new tests (link to the testing docs). Be sure to run the tests locally and fix any errors before submitting the PR (more instructions).
19+
If this change cannot be tested by the CI, please explain how to verify it manually.
20+
-->
21+
22+
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
python-version: ${{ matrix.python }}
4343
architecture: ${{ matrix.arch }}
4444
- name: install tox
45-
run: pip install --upgrade setuptools 'virtualenv<20' tox==3.9.0
45+
run: pip install --upgrade 'setuptools!=50' 'virtualenv<20' tox==3.9.0
4646
- name: setup tox environment
4747
run: tox -e ${{ matrix.toxenv }} --notest
4848
- name: test

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,12 @@ dmypy.json
2323

2424
# IDEs
2525
.idea
26-
*.swp
2726
.vscode
2827

28+
# vim temporary files
29+
.*.sw?
30+
*.sw?
31+
2932
# Operating Systems
3033
.DS_Store
3134

.travis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,12 @@ jobs:
8484
python: 3.7
8585
install: ""
8686
script: RELEASE_SKIP=head ${TRAVIS_BUILD_DIR}/misc/release-test.sh
87-
allow_failures:
88-
- name: "run test suite with python 3.9"
89-
python: 3.9-dev
90-
87+
9188
install:
9289
- pip install -U pip setuptools
9390
- pip install -U 'virtualenv<20'
9491
- pip install -U tox==3.9.0
92+
- python2 -m pip install --user -U typing
9593
- tox --notest
9694

9795
# This is a big hack and only works because the layout of our directories

ISSUE_TEMPLATE.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ recursive-include mypy/typeshed *.py *.pyi
77
recursive-include mypy/xml *.xsd *.xslt *.css
88
recursive-include mypyc/lib-rt *.c *.h *.tmpl *.py *.cc
99
recursive-include mypyc/ir *.py
10+
recursive-include mypyc/analysis *.py
1011
recursive-include mypyc/codegen *.py
1112
recursive-include mypyc/irbuild *.py
1213
recursive-include mypyc/primitives *.py

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Mypy: Optional Static Typing for Python
44
=======================================
55

6-
[![Build Status](https://api.travis-ci.org/python/mypy.svg?branch=master)](https://travis-ci.org/python/mypy)
6+
[![Build Status](https://api.travis-ci.com/python/mypy.svg?branch=master)](https://travis-ci.com/python/mypy)
77
[![Chat at https://gitter.im/python/typing](https://badges.gitter.im/python/typing.svg)](https://gitter.im/python/typing?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
88
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
99

@@ -122,11 +122,8 @@ Mypy can be integrated into popular IDEs:
122122
[its own implementation of PEP 484](https://www.jetbrains.com/help/pycharm/type-hinting-in-product.html))
123123
* VS Code: provides [basic integration](https://code.visualstudio.com/docs/python/linting#_mypy) with mypy.
124124

125-
Mypy can also be integrated into [Flake8] using [flake8-mypy], or
126-
can be set up as a pre-commit hook using [pre-commit mirrors-mypy].
125+
Mypy can also be set up as a pre-commit hook using [pre-commit mirrors-mypy].
127126

128-
[Flake8]: https://flake8.pycqa.org/
129-
[flake8-mypy]: https://github.com/ambv/flake8-mypy
130127
[pre-commit mirrors-mypy]: https://github.com/pre-commit/mirrors-mypy
131128

132129
Web site and documentation
@@ -138,7 +135,7 @@ Documentation and additional information is available at the web site:
138135

139136
Or you can jump straight to the documentation:
140137

141-
http://mypy.readthedocs.io/
138+
https://mypy.readthedocs.io/
142139

143140

144141
Troubleshooting

docs/source/command_line.rst

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ imports.
108108
prefers "classic" packages over namespace packages) along the
109109
module search path -- this is primarily set from the source files
110110
passed on the command line, the ``MYPYPATH`` environment variable,
111-
and the :ref:`mypy_path config option
112-
<config-file-import-discovery>`.
111+
and the :confval:`mypy_path` config option.
113112

114113
Note that this only affects import discovery -- for modules and
115114
packages explicitly passed on the command line, mypy still
@@ -554,6 +553,36 @@ of the above sections.
554553
Note: the exact list of flags enabled by running :option:`--strict` may change
555554
over time.
556555

556+
.. option:: --disable-error-code
557+
558+
This flag allows disabling one or multiple error codes globally.
559+
560+
.. code-block:: python
561+
562+
# no flag
563+
x = 'a string'
564+
x.trim() # error: "str" has no attribute "trim" [attr-defined]
565+
566+
# --disable-error-code attr-defined
567+
x = 'a string'
568+
x.trim()
569+
570+
.. option:: --enable-error-code
571+
572+
This flag allows enabling one or multiple error codes globally.
573+
574+
Note: This flag will override disabled error codes from the --disable-error-code
575+
flag
576+
577+
.. code-block:: python
578+
579+
# --disable-error-code attr-defined
580+
x = 'a string'
581+
x.trim()
582+
583+
# --disable-error-code attr-defined --enable-error-code attr-defined
584+
x = 'a string'
585+
x.trim() # error: "str" has no attribute "trim" [attr-defined]
557586
558587
.. _configuring-error-messages:
559588

0 commit comments

Comments
 (0)