Skip to content

Suggest a more complete annotation pkg for lxml#16284

Closed
abelcheung wants to merge 1 commit intopython:masterfrom
abelcheung:suggest-types-lxml
Closed

Suggest a more complete annotation pkg for lxml#16284
abelcheung wants to merge 1 commit intopython:masterfrom
abelcheung:suggest-types-lxml

Conversation

@abelcheung
Copy link
Copy Markdown

This is a continuation of PR #14737 ; I'd want to officially recommend external annotation I've been working over lxml-stubs, because annotation of the whole lxml package is basically complete (except a few minor submodules that I'm doubtful anybody is using at all), and I'm still actively maintaining it.

@hauntsaninja
Copy link
Copy Markdown
Collaborator

hauntsaninja commented Oct 18, 2023

Thanks for maintaining those stubs!

As the comment mentions, from mypy's perspective, we have to be very careful when recommending packages here. These suggestions will be blindly installed by trusting humans or directly by mypy via --install-types. This is concerning, since Python packages can execute arbitrary code on installation. The policy I suggested in #14328 (comment) was therefore that mypy only suggest stubs maintained by typeshed or by maintainers of the actual project (as far as I can tell you don't have PyPI upload permissions on lxml), since such stub packages do not expand the web of trust for users.

I'm curious what it would take to merge types-lxml into the lxml-stubs that upstream maintains?

@github-actions
Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@abelcheung abelcheung closed this Oct 19, 2023
@abelcheung abelcheung deleted the suggest-types-lxml branch October 19, 2023 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants