From 72c0a02989163a79b23e0fb7ef7902fac10d3bb0 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Mon, 25 Apr 2022 11:37:10 +0100 Subject: [PATCH] Allow extras to be installed for typechecking --- .github/workflows/python-poetry-ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/python-poetry-ci.yml b/.github/workflows/python-poetry-ci.yml index f0b5ac5..d8d5957 100644 --- a/.github/workflows/python-poetry-ci.yml +++ b/.github/workflows/python-poetry-ci.yml @@ -1,6 +1,17 @@ name: Linting on: workflow_call: + inputs: + extras: + description: > + Space-separated list of extras to install when type checking. + Defaults to no extras. + # In the future I'd like to change setup-python-poetry to install all extras + # by default, using e.g. an implementation of + # https://github.com/python-poetry/poetry/issues/3413 + type: string + required: false + default: "" jobs: @@ -33,6 +44,9 @@ jobs: - name: Setup Poetry uses: matrix-org/setup-python-poetry@v1 + with: + # We want to make use of type hints in optional dependencies too. + extras: "${{ inputs.extras }}" - name: Restore/persist mypy's cache uses: AustinScola/mypy-cache-github-action@v1