From 3b905eff741a3064145d178a2c0dc38b7762075d Mon Sep 17 00:00:00 2001 From: zhukovgreen Date: Wed, 26 Apr 2023 18:33:57 +0200 Subject: [PATCH 1/2] Add mypy-plugin extra dependency use `pip install classes[mypy-plugin]` for installin additional dependencies required by the mypy-plugin. Add mypy-plugin extra dependency use `pip install classes[mypy-plugin]` for installing additional dependencies required by the mypy-plugin. --- README.md | 5 +++++ poetry.lock | 5 ++++- pyproject.toml | 6 +++++- 3 files changed, 14 insertions(+), 2 deletions(-) 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..9e77a2e4f 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 = "60e0b58b295abf5d7fc913a729b929391cab28055c4b4f4f8eb58abccf8af6f5" diff --git a/pyproject.toml b/pyproject.toml index af811c75b..cbe41d1f6 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,7 @@ trio = "^0.22" attrs = "^23.1" httpx = "^0.24" -mypy = "^1.4" +mypy = "^1.4.0" wemake-python-styleguide = "^0.17" flake8-pytest-style = "^1.6" flake8-pyi = "^23.4" @@ -81,6 +82,9 @@ doc8 = "^1.0" m2r2 = "^0.3" tomlkit = "^0.11" +[tool.poetry.extras] +compatible-mypy = ["mypy"] + [build-system] requires = ["poetry-core>=1.5.0"] From ac97a890f6a044e254c1c51693c3f977029e1f16 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Tue, 27 Jun 2023 17:44:30 +0300 Subject: [PATCH 2/2] Remove mypy from dev deps --- .github/workflows/test.yml | 2 +- poetry.lock | 2 +- pyproject.toml | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) 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/poetry.lock b/poetry.lock index 9e77a2e4f..b72af6bef 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2581,4 +2581,4 @@ compatible-mypy = ["mypy"] [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "60e0b58b295abf5d7fc913a729b929391cab28055c4b4f4f8eb58abccf8af6f5" +content-hash = "18cd7cc3d91537f3b193acaf27bd3ef3cc631ad259f53b0e399cdea074659721" diff --git a/pyproject.toml b/pyproject.toml index cbe41d1f6..8775f3de1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,6 @@ trio = "^0.22" attrs = "^23.1" httpx = "^0.24" -mypy = "^1.4.0" wemake-python-styleguide = "^0.17" flake8-pytest-style = "^1.6" flake8-pyi = "^23.4"