Skip to content

Commit 7241b6c

Browse files
authored
Update documentation links (#10159)
Co-authored-by: hauntsaninja <>
1 parent 0aa2caf commit 7241b6c

39 files changed

+226
-225
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Getting started, building, and testing
1212

1313
If you haven't already, take a look at the project's
1414
[README.md file](README.md)
15-
and the [Mypy documentation](http://mypy.readthedocs.io/en/latest/),
15+
and the [Mypy documentation](https://mypy.readthedocs.io/en/latest/),
1616
and try adding type annotations to your file and type-checking it with Mypy.
1717

1818

mypy/errors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,8 @@ def report_internal_error(err: Exception,
721721
# Print "INTERNAL ERROR" message.
722722
print('{}error: INTERNAL ERROR --'.format(prefix),
723723
'Please try using mypy master on Github:\n'
724-
'https://mypy.rtfd.io/en/latest/common_issues.html#using-a-development-mypy-build',
724+
'https://mypy.readthedocs.io/en/stable/common_issues.html'
725+
'#using-a-development-mypy-build',
725726
file=stderr)
726727
if options.show_traceback:
727728
print('Please report a bug at https://github.com/python/mypy/issues',

mypy/main.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,17 +248,17 @@ def infer_python_executable(options: Options,
248248
249249
For more information on getting started, see:
250250
251-
- http://mypy.readthedocs.io/en/latest/getting_started.html
251+
- https://mypy.readthedocs.io/en/stable/getting_started.html
252252
253253
For more details on both running mypy and using the flags below, see:
254254
255-
- http://mypy.readthedocs.io/en/latest/running_mypy.html
256-
- http://mypy.readthedocs.io/en/latest/command_line.html
255+
- https://mypy.readthedocs.io/en/stable/running_mypy.html
256+
- https://mypy.readthedocs.io/en/stable/command_line.html
257257
258258
You can also use a config file to configure mypy instead of using
259259
command line flags. For more details, see:
260260
261-
- http://mypy.readthedocs.io/en/latest/config_file.html
261+
- https://mypy.readthedocs.io/en/stable/config_file.html
262262
""" # type: Final
263263

264264
FOOTER = """Environment variables:
@@ -557,7 +557,7 @@ def add_invertible_flag(flag: str,
557557
title='None and Optional handling',
558558
description="Adjust how values of type 'None' are handled. For more context on "
559559
"how mypy handles values of type 'None', see: "
560-
"http://mypy.readthedocs.io/en/latest/kinds_of_types.html#no-strict-optional")
560+
"https://mypy.readthedocs.io/en/stable/kinds_of_types.html#no-strict-optional")
561561
add_invertible_flag('--no-implicit-optional', default=False, strict_flag=True,
562562
help="Don't assume arguments with default values of None are Optional",
563563
group=none_group)
@@ -668,7 +668,7 @@ def add_invertible_flag(flag: str,
668668
"Mypy caches type information about modules into a cache to "
669669
"let you speed up future invocations of mypy. Also see "
670670
"mypy's daemon mode: "
671-
"mypy.readthedocs.io/en/latest/mypy_daemon.html#mypy-daemon")
671+
"mypy.readthedocs.io/en/stable/mypy_daemon.html#mypy-daemon")
672672
incremental_group.add_argument(
673673
'-i', '--incremental', action='store_true',
674674
help=argparse.SUPPRESS)
@@ -804,7 +804,7 @@ def add_invertible_flag(flag: str,
804804
code_group = parser.add_argument_group(
805805
title="Running code",
806806
description="Specify the code you want to type check. For more details, see "
807-
"mypy.readthedocs.io/en/latest/running_mypy.html#running-mypy")
807+
"mypy.readthedocs.io/en/stable/running_mypy.html#running-mypy")
808808
code_group.add_argument(
809809
'--explicit-package-bases', action='store_true',
810810
help="Use current directory and MYPYPATH to determine module names of files passed")

mypy/messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2077,7 +2077,7 @@ def append_invariance_notes(notes: List[str], arg_type: Instance,
20772077
if invariant_type and covariant_suggestion:
20782078
notes.append(
20792079
'"{}" is invariant -- see '.format(invariant_type) +
2080-
'http://mypy.readthedocs.io/en/latest/common_issues.html#variance')
2080+
"https://mypy.readthedocs.io/en/stable/common_issues.html#variance")
20812081
notes.append(covariant_suggestion)
20822082
return notes
20832083

mypy/modulefinder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class ModuleNotFoundReason(Enum):
6060
STUBS_NOT_INSTALLED = 3
6161

6262
def error_message_templates(self) -> Tuple[str, List[str]]:
63-
doc_link = "See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports"
63+
doc_link = "See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports"
6464
if self is ModuleNotFoundReason.NOT_FOUND:
6565
msg = 'Cannot find implementation or library stub for module named "{module}"'
6666
notes = [doc_link]
@@ -696,7 +696,7 @@ def compute_search_paths(sources: List[BuildSource],
696696
any(p.startswith(site_dir + os.path.sep) for p in mypypath) or
697697
os.path.altsep and any(p.startswith(site_dir + os.path.altsep) for p in mypypath)):
698698
print("{} is in the MYPYPATH. Please remove it.".format(site_dir), file=sys.stderr)
699-
print("See https://mypy.readthedocs.io/en/latest/running_mypy.html"
699+
print("See https://mypy.readthedocs.io/en/stable/running_mypy.html"
700700
"#how-mypy-handles-imports for more info", file=sys.stderr)
701701
sys.exit(1)
702702
elif site_dir in python_path:

mypy/typeanal.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ def analyze_unbound_type_without_type_info(self, t: UnboundType, sym: SymbolTabl
458458
notes = [] # type: List[str]
459459
if isinstance(sym.node, Var):
460460
notes.append('See https://mypy.readthedocs.io/en/'
461-
'latest/common_issues.html#variables-vs-type-aliases')
461+
'stable/common_issues.html#variables-vs-type-aliases')
462462
message = 'Variable "{}" is not valid as a type'
463463
elif isinstance(sym.node, (SYMBOL_FUNCBASE_TYPES, Decorator)):
464464
message = 'Function "{}" is not valid as a type'
@@ -1040,8 +1040,8 @@ def get_omitted_any(disallow_any: bool, fail: MsgCallback, note: MsgCallback,
10401040
# (string literal escaping) for classes not generic at runtime
10411041
note(
10421042
"Subscripting classes that are not generic at runtime may require "
1043-
"escaping, see https://mypy.readthedocs.io/"
1044-
"en/latest/common_issues.html#not-generic-runtime",
1043+
"escaping, see https://mypy.readthedocs.io/en/stable/runtime_troubles.html"
1044+
"#not-generic-runtime",
10451045
typ,
10461046
code=codes.TYPE_ARG)
10471047

test-data/unit/check-basic.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ from typing import List
409409
x: List[int]
410410
y: List[float]
411411
y = x # E: Incompatible types in assignment (expression has type "List[int]", variable has type "List[float]") \
412-
# N: "List" is invariant -- see http://mypy.readthedocs.io/en/latest/common_issues.html#variance \
412+
# N: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance \
413413
# N: Consider using "Sequence" instead, which is covariant
414414
[builtins fixtures/list.pyi]
415415

@@ -418,7 +418,7 @@ from typing import Dict
418418
x: Dict[str, int]
419419
y: Dict[str, float]
420420
y = x # E: Incompatible types in assignment (expression has type "Dict[str, int]", variable has type "Dict[str, float]") \
421-
# N: "Dict" is invariant -- see http://mypy.readthedocs.io/en/latest/common_issues.html#variance \
421+
# N: "Dict" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance \
422422
# N: Consider using "Mapping" instead, which is covariant in the value type
423423
[builtins fixtures/dict.pyi]
424424

test-data/unit/check-columns.test

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,21 +154,21 @@ from typing import Iterable
154154
bad = 0
155155

156156
def f(x: bad): # E:10: Variable "__main__.bad" is not valid as a type \
157-
# N:10: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases
157+
# N:10: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
158158
y: bad # E:8: Variable "__main__.bad" is not valid as a type \
159-
# N:8: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases
159+
# N:8: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
160160

161161
if int():
162162
def g(x): # E:5: Variable "__main__.bad" is not valid as a type \
163-
# N:5: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases
163+
# N:5: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
164164
# type: (bad) -> None
165165
y = 0 # type: bad # E:9: Variable "__main__.bad" is not valid as a type \
166-
# N:9: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases
166+
# N:9: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
167167

168168
z: Iterable[bad] # E:13: Variable "__main__.bad" is not valid as a type \
169-
# N:13: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases
169+
# N:13: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
170170
h: bad[int] # E:4: Variable "__main__.bad" is not valid as a type \
171-
# N:4: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases
171+
# N:4: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
172172

173173
[case testColumnInvalidType_python2]
174174

@@ -178,13 +178,13 @@ bad = 0
178178

179179
if int():
180180
def g(x): # E:5: Variable "__main__.bad" is not valid as a type \
181-
# N:5: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases
181+
# N:5: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
182182
# type: (bad) -> None
183183
y = 0 # type: bad # E:9: Variable "__main__.bad" is not valid as a type \
184-
# N:9: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases
184+
# N:9: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
185185

186186
z = () # type: Iterable[bad] # E:5: Variable "__main__.bad" is not valid as a type \
187-
# N:5: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases
187+
# N:5: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
188188

189189
[case testColumnFunctionMissingTypeAnnotation]
190190
# flags: --disallow-untyped-defs

test-data/unit/check-custom-plugin.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,13 +498,13 @@ Bad1 = non_declarative_base()
498498
Bad2 = Bad3 = declarative_base()
499499

500500
class C1(Bad1): ... # E: Variable "__main__.Bad1" is not valid as a type \
501-
# N: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases \
501+
# N: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases \
502502
# E: Invalid base class "Bad1"
503503
class C2(Bad2): ... # E: Variable "__main__.Bad2" is not valid as a type \
504-
# N: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases \
504+
# N: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases \
505505
# E: Invalid base class "Bad2"
506506
class C3(Bad3): ... # E: Variable "__main__.Bad3" is not valid as a type \
507-
# N: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases \
507+
# N: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases \
508508
# E: Invalid base class "Bad3"
509509
[file mod.py]
510510
from typing import Generic, TypeVar

test-data/unit/check-errorcodes.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ x: f # E: Function "__main__.f" is not valid as a type [valid-type] \
251251
import sys
252252
y: sys # E: Module "sys" is not valid as a type [valid-type]
253253
z: y # E: Variable "__main__.y" is not valid as a type [valid-type] \
254-
# N: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases
254+
# N: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
255255
[builtins fixtures/tuple.pyi]
256256

257257
[case testErrorCodeNeedTypeAnnotation]
@@ -500,7 +500,7 @@ if int() is str(): # E: Non-overlapping identity check (left operand type: "int
500500

501501
[case testErrorCodeMissingModule]
502502
from defusedxml import xyz # E: Cannot find implementation or library stub for module named "defusedxml" [import] \
503-
# N: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
503+
# N: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
504504
from nonexistent import foobar # E: Cannot find implementation or library stub for module named "nonexistent" [import]
505505
import nonexistent2 # E: Cannot find implementation or library stub for module named "nonexistent2" [import]
506506
from nonexistent3 import * # E: Cannot find implementation or library stub for module named "nonexistent3" [import]

test-data/unit/check-flags.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ main:2: note: (Using --follow-imports=error, module not passed on command line)
454454
from mod import x
455455
[out]
456456
main:1: error: Cannot find implementation or library stub for module named "mod"
457-
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
457+
main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
458458

459459
[case testIgnoreMissingImportsTrue]
460460
# flags: --ignore-missing-imports
@@ -611,7 +611,7 @@ def f(x: MyType) -> None:
611611
pass
612612
[out]
613613
main:2: error: Cannot find implementation or library stub for module named "missing"
614-
main:2: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
614+
main:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
615615
main:4: error: Argument 1 to "f" becomes "Any" due to an unfollowed import
616616

617617
[case testDisallowImplicitAnyVariableDefinition]
@@ -1122,9 +1122,9 @@ x: Future[str]
11221122
y: Queue[int]
11231123

11241124
p: Future # E: Missing type parameters for generic type "Future" \
1125-
# N: Subscripting classes that are not generic at runtime may require escaping, see https://mypy.readthedocs.io/en/latest/common_issues.html#not-generic-runtime
1125+
# N: Subscripting classes that are not generic at runtime may require escaping, see https://mypy.readthedocs.io/en/stable/runtime_troubles.html#not-generic-runtime
11261126
q: Queue # E: Missing type parameters for generic type "Queue" \
1127-
# N: Subscripting classes that are not generic at runtime may require escaping, see https://mypy.readthedocs.io/en/latest/common_issues.html#not-generic-runtime
1127+
# N: Subscripting classes that are not generic at runtime may require escaping, see https://mypy.readthedocs.io/en/stable/runtime_troubles.html#not-generic-runtime
11281128
[builtins fixtures/async_await.pyi]
11291129
[typing fixtures/typing-full.pyi]
11301130

test-data/unit/check-functions.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,14 +2392,14 @@ from typing import Union, Dict, List
23922392
def f() -> List[Union[str, int]]:
23932393
x = ['a']
23942394
return x # E: Incompatible return value type (got "List[str]", expected "List[Union[str, int]]") \
2395-
# N: "List" is invariant -- see http://mypy.readthedocs.io/en/latest/common_issues.html#variance \
2395+
# N: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance \
23962396
# N: Consider using "Sequence" instead, which is covariant \
23972397
# N: Perhaps you need a type annotation for "x"? Suggestion: "List[Union[str, int]]"
23982398

23992399
def g() -> Dict[str, Union[str, int]]:
24002400
x = {'a': 'a'}
24012401
return x # E: Incompatible return value type (got "Dict[str, str]", expected "Dict[str, Union[str, int]]") \
2402-
# N: "Dict" is invariant -- see http://mypy.readthedocs.io/en/latest/common_issues.html#variance \
2402+
# N: "Dict" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance \
24032403
# N: Consider using "Mapping" instead, which is covariant in the value type \
24042404
# N: Perhaps you need a type annotation for "x"? Suggestion: "Dict[str, Union[str, int]]"
24052405

@@ -2411,7 +2411,7 @@ def h() -> Dict[Union[str, int], str]:
24112411
def i() -> List[Union[int, float]]:
24122412
x: List[int] = [1]
24132413
return x # E: Incompatible return value type (got "List[int]", expected "List[Union[int, float]]") \
2414-
# N: "List" is invariant -- see http://mypy.readthedocs.io/en/latest/common_issues.html#variance \
2414+
# N: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance \
24152415
# N: Consider using "Sequence" instead, which is covariant
24162416

24172417
[builtins fixtures/dict.pyi]

test-data/unit/check-generics.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -986,10 +986,10 @@ class C:
986986
if int():
987987
c = int
988988
def f(self, x: a) -> None: pass # E: Variable "__main__.C.a" is not valid as a type \
989-
# N: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases
989+
# N: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
990990
def g(self, x: b) -> None: pass
991991
def h(self, x: c) -> None: pass # E: Variable "__main__.C.c" is not valid as a type \
992-
# N: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases
992+
# N: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
993993
x: b
994994
reveal_type(x) # N: Revealed type is 'Union[builtins.int, builtins.str]'
995995
[out]

test-data/unit/check-incremental.test

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2136,7 +2136,7 @@ x = 1
21362136
[stale]
21372137
[out2]
21382138
tmp/n.py:1: error: Cannot find implementation or library stub for module named "m"
2139-
tmp/n.py:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
2139+
tmp/n.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
21402140

21412141
[case testDeleteFileWithinCycle]
21422142
import a
@@ -3434,7 +3434,7 @@ import a
34343434

34353435
[out2]
34363436
main:2: error: Cannot find implementation or library stub for module named "a"
3437-
main:2: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
3437+
main:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
34383438

34393439
[case testIncrementalInheritanceAddAnnotation]
34403440
# flags: --strict-optional
@@ -3577,7 +3577,7 @@ def f(x: int) -> None: pass
35773577
[out]
35783578
[out2]
35793579
main:1: error: Cannot find implementation or library stub for module named "p.q"
3580-
main:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
3580+
main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
35813581
[out3]
35823582
main:2: error: Missing positional argument "x" in call to "f"
35833583

@@ -4210,10 +4210,10 @@ def __getattr__(attr: str) -> Any: ...
42104210
[builtins fixtures/module.pyi]
42114211
[out]
42124212
tmp/c.py:1: error: Cannot find implementation or library stub for module named "a.b.c"
4213-
tmp/c.py:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
4213+
tmp/c.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
42144214
[out2]
42154215
tmp/c.py:1: error: Cannot find implementation or library stub for module named "a.b.c"
4216-
tmp/c.py:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
4216+
tmp/c.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
42174217

42184218
[case testAddedMissingStubs]
42194219
# flags: --ignore-missing-imports

0 commit comments

Comments
 (0)