Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow extras to be installed for typechecking #6

Merged
merged 1 commit into from
Apr 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/python-poetry-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
name: Linting
on:
workflow_call:
inputs:
typechecking-extras:
description: >
Space-separated list of package extras to install when type checking.
(I.e. the entries in `pyproject.toml`'s `[tool.poetry.extras]` section.)
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:
Expand Down Expand Up @@ -33,6 +45,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.typechecking-extras }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems OK -- should we use just extras for this though instead of typechecking-extras?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to emphasise that this was only going to install extras to run mypy; flake8, isort, black all run from the "bare" set of developer dependencies that poetry defines.

Not a strongly-held opinion though; happy to change if you think extras is clearer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Ah, I see. I think it is fine either way, just wasn't sure of the rationale!


- name: Restore/persist mypy's cache
uses: AustinScola/mypy-cache-github-action@v1
Expand Down