diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c432ac873..7cbc130c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,7 +50,7 @@ jobs: - name: Install dependencies run: | poetry config virtualenvs.in-project true - poetry install + poetry install --extras=compatible-mypy poetry run pip install -U pip diff --git a/README.md b/README.md index 7b8436e55..7739068f8 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,11 @@ You are also required to [configure](https://returns.readthedocs.io/en/latest/pa `mypy` correctly and install our plugin to fix [this existing issue](https://github.com/python/mypy/issues/3157): +```bash +pip install returns[compatible-mypy] +``` +and + ```ini # In setup.cfg or mypy.ini: [mypy] diff --git a/poetry.lock b/poetry.lock index e7d244624..b72af6bef 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2575,7 +2575,10 @@ files = [ docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] +[extras] +compatible-mypy = ["mypy"] + [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "a48e1ac3c47dfccb3d1ff8503c9ef171b17ca3177ce09d2a7abc2709dc24f2b3" +content-hash = "18cd7cc3d91537f3b193acaf27bd3ef3cc631ad259f53b0e399cdea074659721" diff --git a/pyproject.toml b/pyproject.toml index af811c75b..8775f3de1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,7 @@ _ = "returns.contrib.hypothesis._entrypoint" python = "^3.7" typing-extensions = ">=4.0,<5.0" +mypy = { version = "^1.4.0", optional = true } [tool.poetry.dev-dependencies] anyio = "^3.7" @@ -55,7 +56,6 @@ trio = "^0.22" attrs = "^23.1" httpx = "^0.24" -mypy = "^1.4" wemake-python-styleguide = "^0.17" flake8-pytest-style = "^1.6" flake8-pyi = "^23.4" @@ -81,6 +81,9 @@ doc8 = "^1.0" m2r2 = "^0.3" tomlkit = "^0.11" +[tool.poetry.extras] +compatible-mypy = ["mypy"] + [build-system] requires = ["poetry-core>=1.5.0"]