From 639bf779169d30e793fd62b138cfae5fc2204e62 Mon Sep 17 00:00:00 2001 From: otaj <6065855+otaj@users.noreply.github.com> Date: Thu, 13 Oct 2022 16:46:40 +0200 Subject: [PATCH] Bump Python version for mypy check (#15126) --- .github/workflows/code-checks.yml | 8 +++++--- pyproject.toml | 10 +++------- .../trainer/connectors/callback_connector.py | 4 ++-- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml index cf74675118..7e0c9a2e4c 100644 --- a/.github/workflows/code-checks.yml +++ b/.github/workflows/code-checks.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: '3.10.6' # Note: This uses an internal pip API and may not always work # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow @@ -35,8 +35,10 @@ jobs: pip install torch==1.12 --find-links https://download.pytorch.org/whl/cpu/torch_stable.html python ./requirements/pytorch/adjust-versions.py requirements/pytorch/extra.txt # todo: adjust requirements for both code-bases - pip install -r requirements/pytorch/devel.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html + pip install -r requirements/pytorch/devel.txt -r requirements/app/devel.txt -r requirements/lite/devel.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html pip list - name: Check typing - run: mypy + run: | + mkdir .mypy_cache + mypy diff --git a/pyproject.toml b/pyproject.toml index 6a77a34f27..687a31b966 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,11 +28,11 @@ exclude = '(_notebooks/.*)' files = [ "src/pytorch_lightning", "src/lightning_lite", - "src/lightning_app/", + "src/lightning_app", ] exclude = [ - "src/lightning_app/cli/component-template/", - "src/lightning_app/cli/pl-app-template/", + "src/lightning_app/cli/component-template", + "src/lightning_app/cli/pl-app-template", "src/lightning_app/cli/react-ui-template", "src/lightning_app/cli/app-template", ] @@ -58,10 +58,6 @@ warn_no_return = "False" module = [ "lightning_app.api.http_methods", "lightning_app.api.request_types", - "lightning_app.cli.app-template.app", - "lightning_app.cli.app-template.placeholdername.components.component_a.component_a", - "lightning_app.cli.app-template.placeholdername.components.component_b.component_a", - "lightning_app.cli.app-template.tests.test_placeholdername_app", "lightning_app.cli.commands.app_commands", "lightning_app.cli.commands.connection", "lightning_app.cli.react-ui-template.example_app", diff --git a/src/pytorch_lightning/trainer/connectors/callback_connector.py b/src/pytorch_lightning/trainer/connectors/callback_connector.py index ea0ed649d6..ba1b5b8bf7 100644 --- a/src/pytorch_lightning/trainer/connectors/callback_connector.py +++ b/src/pytorch_lightning/trainer/connectors/callback_connector.py @@ -271,9 +271,9 @@ def _configure_external_callbacks() -> List[Callback]: from importlib.metadata import entry_points if _PYTHON_GREATER_EQUAL_3_10_0: - factories = entry_points(group=group) # type: ignore[call-arg] + factories = entry_points(group=group) else: - factories = entry_points().get(group, {}) # type: ignore[assignment] + factories = entry_points().get(group, {}) # type: ignore[arg-type] else: from pkg_resources import iter_entry_points