error: Error importing plugin "returns.contrib.mypy.returns_plugin": No module named 'returns' [misc]
wizard-28 opened this issue ยท 7 comments
wizard-28 commented
Bug report
What's wrong
Mypy is unable to use the plugin. It errors out with the following message:
error: Error importing plugin "returns.contrib.mypy.returns_plugin": No module named 'returns' [misc]
Here's my pyproject.toml
:
[tool.poetry]
name = "test"
version = "0.1.0"
description = ""
authors = ["Sourajyoti Basak <wiz28@protonmail.com>"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
returns = "^0.19.0"
mypy = "^0.950"
[tool.mypy]
plugins = ["returns.contrib.mypy.returns_plugin"]
allow_redefinition = false
check_untyped_defs = true
ignore_errors = false
ignore_missing_imports = true
implicit_reexport = false
local_partial_types = true
no_implicit_optional = true
strict_equality = true
strict_optional = true
warn_no_return = true
warn_redundant_casts = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
How is that should be
mypy successfully works.
System information
python
version:3.10.6
returns
version:0.19.0
mypy
version:0.950
sobolevn commented
Can you try checking import returns
with python and mypy without a plugin?
wizard-28 commented
Can you try checking
import returns
with python and mypy without a plugin?
code/python/test is ๐ฆ v0.1.0 via ๐ v3.10.6 (test-py3.10) took 4s
ฮป bat pyproject.toml
โโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ File: pyproject.toml
โโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
1 โ [tool.poetry]
2 โ name = "test"
3 โ version = "0.1.0"
4 โ description = ""
5 โ authors = ["Sourajyoti Basak <wiz28@protonmail.com>"]
6 โ readme = "README.md"
7 โ
8 โ [tool.poetry.dependencies]
9 โ python = "^3.10"
10 โ returns = "^0.19.0"
11 โ mypy = "^0.950"
12 โ
13 โ [tool.mypy]
14 โ # plugins = ["returns.contrib.mypy.returns_plugin"]
15 โ allow_redefinition = false
16 โ check_untyped_defs = true
17 โ ignore_errors = false
18 โ ignore_missing_imports = true
19 โ implicit_reexport = false
20 โ local_partial_types = true
21 โ no_implicit_optional = true
22 โ strict_equality = true
23 โ strict_optional = true
24 โ warn_no_return = true
25 โ warn_redundant_casts = true
26 โ warn_unreachable = true
27 โ warn_unused_configs = true
28 โ warn_unused_ignores = true
29 โ
30 โ [build-system]
31 โ requires = ["poetry-core"]
32 โ build-backend = "poetry.core.masonry.api"
โโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
code/python/test is ๐ฆ v0.1.0 via ๐ v3.10.6 (test-py3.10) took 5s
ฮป bat test/__init__.py
โโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ File: test/__init__.py
โโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
1 โ import returns
โโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
code/python/test is ๐ฆ v0.1.0 via ๐ v3.10.6 (test-py3.10)
ฮป mypy test/
Success: no issues found in 1 source file
sobolevn commented
Can you run test/__init__.py
with python
? python test/__init__.py
wizard-28 commented
Can you run
test/__init__.py
withpython
?python test/__init__.py
code/python/test is ๐ฆ v0.1.0 via ๐ v3.10.6 (test-py3.10)
ฮป python3 ./test/__init__.py
code/python/test is ๐ฆ v0.1.0 via ๐ v3.10.6 (test-py3.10)
ฮป
sobolevn commented
Sorry, I cannot reproduce it :(
sobolevn commented
Can you please create a docker image with this problem?
aivanoved commented
I have encountered the same error, will be trying to make a minimum example (it has been difficult to do so, though)
Setup:
python
: 3.11.4
returns
: 0.19.0
mypy
: 1.4.1