dry-python / dry-python/returns

error: Error importing plugin "returns.contrib.mypy.returns_plugin": No module named 'returns' [misc]

未关闭
#1,577 7 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Python
星标
4.4k
派生
155
平均合并
2 小时 27 分钟
30 天内合并 PR
22

描述

# 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`:

```toml
[tool.poetry]
name = "test"
version = "0.1.0"
description = ""
authors = ["Sourajyoti Basak "]
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`

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。