-
Notifications
You must be signed in to change notification settings - Fork 4
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
Conversation
b770fc0
to
72c0a02
Compare
72c0a02
to
412b83f
Compare
@@ -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 }}" |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
Now that matrix-org/backend-meta#6 is merged to the release/v1 branch.
Over time we've begun to use newer versions of mypy, typeshed, stub packages---and of course we've improved our own annotations. This makes some type ignore comments no longer necessary. I have removed them. There was one exception: a module that imports `select.epoll`. The ignore is redundant on Linux, but I've kept it ignored for those of us who work on the source tree using not-Linux. (#11771) I'm more interested in the config line which enforces this. I want unused ignores to be reported, because I think it's useful feedback when annotating to know when you've fixed a problem you had to previously ignore. * Installing extras before typechecking Lacking an easy way to install all extras generically, let's bite the bullet and make install the hand-maintained `all` extra before typechecking. Now that matrix-org/backend-meta#6 is merged to the release/v1 branch.
In matrix-org/synapse#12531 I was bitten by a different mypy result in CI to my local environment. CI was running
poetry install
; I had runpoetry install --extras all
locally.I had intended for poetry's development environment (its list of dev-dependencies) to be sufficient for all development tasks. But that ideal doesn't work well here. On reflection, let's allow this action to install a list of extras for typechecking only.
Proof that this works: https://github.com/matrix-org/synapse/runs/6156325285?check_suite_focus=true#step:3:3 shows that we pass the extras through to
setup-python-poetry
.Once merged, I'll do a minor release (1.3.0) and forward the v1 tag.