Skip to content

Pin CI version of click to resolve mypy error - #2769

Merged
zanieb merged 3 commits into
masterfrom
ci/click-version
Jul 12, 2023
Merged

Pin CI version of click to resolve mypy error#2769
zanieb merged 3 commits into
masterfrom
ci/click-version

Conversation

@zanieb

@zanieb zanieb commented Jul 12, 2023

Copy link
Copy Markdown
Contributor

CI is failing (e.g. #2768) because of a mypy/click bug ref pallets/click#2558

❯ mypy httpx
httpx/_main.py:308: error: Argument 1 has incompatible type "Callable[[str, str, list[tuple[str, str]], str, list[tuple[str, str]], list[tuple[str, File]], str, list[tuple[str, str]], list[tuple[str, str]], tuple[str, str] | None, str, float, bool, bool, bool, BinaryIO | None, bool], None]"; expected <nothing>  [arg-type]
Found 1 error in 1 file (checked 24 source files)

This is resolves the type error by temporarily adding a bound to the supported click version and can be reverted once the bug is fixed upstream.

Additional refs pallets/click#2559 pallets/click#2562 python/mypy#13449

@zanieb
zanieb requested a review from lovelydinosaur July 12, 2023 00:51
@Kludex

Kludex commented Jul 12, 2023

Copy link
Copy Markdown
Contributor

It looks like a release in click will happen soon, fyi

@zanieb

zanieb commented Jul 12, 2023

Copy link
Copy Markdown
Contributor Author

I tried the linked pull request locally and it didn't work — figure we might as well be unblocked in the meantime but don't have strong feelings.

@lovelydinosaur

lovelydinosaur commented Jul 12, 2023

Copy link
Copy Markdown
Member

Ah well caught.

We'd probably want to resolve a CI failure by pinning in requirements.txt, rather than in our packaging.

figure we might as well be unblocked in the meantime

Yep.

@zanieb

zanieb commented Jul 12, 2023

Copy link
Copy Markdown
Contributor Author

@tomchristie done!

@zanieb zanieb changed the title Add upper bound to click version to fix mypy error Jul 12, 2023
@zanieb
zanieb merged commit 2c49a15 into master Jul 12, 2023
@zanieb
zanieb deleted the ci/click-version branch July 12, 2023 14:07
samclearman pushed a commit to titanmsp/httpx that referenced this pull request Apr 26, 2025
* Add upper bound to click version to fix mypy error

* Move pin to `requirements.txt`

* Restore `pyproject.toml`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants