Skip to content

more typechecking#5485

Merged
radoering merged 10 commits into
python-poetry:masterfrom
dimbleby:more-typechecking
May 3, 2022
Merged

more typechecking#5485
radoering merged 10 commits into
python-poetry:masterfrom
dimbleby:more-typechecking

Conversation

@dimbleby
Copy link
Copy Markdown
Contributor

Experimenting with the effect of putting a py.typed in poetry-core, so that types from poetry-core count for something over here.

That generates lots and lots of new errors, I've picked off a fairly random selection of them here until I got bored.

@dimbleby dimbleby force-pushed the more-typechecking branch 5 times, most recently from db50123 to 8a0af05 Compare April 23, 2022 15:13
@dimbleby
Copy link
Copy Markdown
Contributor Author

(errors reported in #5476 would have been revealed by the typechecking, if poetry-core had a py.typed)

@dimbleby
Copy link
Copy Markdown
Contributor Author

This MR's project of cleaning up errors revealed by having a py.typed in poetry-core is complete as of the latest commit, with a couple of exceptions:

  • obviously there are still quite a few files excluded from mypy checking altogether, I haven't made a dent in those
  • I still have these two errors:
src/poetry/repositories/link_sources/base.py:82: error: Argument 1 to "Package" has incompatible type "Optional[str]"; expected "str"  [arg-type]
src/poetry/repositories/link_sources/base.py:82: error: Argument 2 to "Package" has incompatible type "Optional[Version]"; expected "Union[str, Version]"  [arg-type]

which is #5476, more or less. cc @abn.

(recent commits have mostly been finding a way around the typechecking when dealing with tomlkit, whose types seem to be... hard to use)

@dimbleby
Copy link
Copy Markdown
Contributor Author

Although I now see that because pre-commit runs in an incomplete environment - #5279 - it doesn't see all the errors that it should and therefore insists that I a making a redundant cast. Hmm.

@dimbleby dimbleby force-pushed the more-typechecking branch from aa3a1b0 to 967a315 Compare May 2, 2022 14:09
Comment thread src/poetry/repositories/pool.py
dimbleby added 2 commits May 2, 2022 19:11
signal failure with `PackageNotFound`, rather than by returning None
Comment thread src/poetry/repositories/pool.py
@radoering radoering merged commit 3d6ffce into python-poetry:master May 3, 2022
@dimbleby dimbleby deleted the more-typechecking branch May 3, 2022 14:42
@kasteph kasteph mentioned this pull request May 30, 2022
@github-actions
Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants