Skip to content

Conversation

@JelleZijlstra
Copy link
Member

Fixes #525.

As discussed there, these stubs are too incomplete and frequently cause problems.

@JelleZijlstra
Copy link
Member Author

That doesn't work because mypy itself needs lxml. @gvanrossum what are your thoughts? Should mypy check itself with more permissive flags?

@gvanrossum
Copy link
Member

There are only three imports of lxml in mypy (two in tests). Maybe we should just put # type: ignore on those lines?

@funkyfuture
Copy link

is there any advice how to proceed with incomplete stubs? i'm thinking of another repository or a branch here (possibly in plural if scoped on one library) to compile stubs as users need them until considered complete to get integrated here. for lxml in particular i'm keen to contribute to get my sh*t straight.

@JelleZijlstra
Copy link
Member Author

I think the best solution is to make a separate repo, like https://github.com/JelleZijlstra/sqlalchemy-stubs. Unfortunately, support for using such stubs is currently kind of hacky—PEP 561 (https://www.python.org/dev/peps/pep-0561/) will make that better once it's implemented.

JelleZijlstra added a commit to JelleZijlstra/mypy that referenced this pull request Nov 7, 2017
See python/typeshed#525 and python/typeshed#1664.

We decided to remove the lxml stubs because they cause problems so
frequently. However, this requires small tweaks to mypy's own usage
of lxml.

My plan is to proceed as follows:
- Merge this PR, adding type ignores and removing warn_unused_ignores
  from mypy's self-check config.
- Merge python/typeshed#1664, which should pass Travis after his PR
  is merged.
- Add "warn_unused_ignores" back to mypy's self-check config.

I confirmed that this PR passes tests both with and without the
lxml stubs being present.
JukkaL pushed a commit to python/mypy that referenced this pull request Nov 7, 2017
See python/typeshed#525 and python/typeshed#1664.

We decided to remove the lxml stubs because they cause problems so
frequently. However, this requires small tweaks to mypy's own usage
of lxml.

My plan is to proceed as follows:
- Merge this PR, adding type ignores and removing warn_unused_ignores
  from mypy's self-check config.
- Merge python/typeshed#1664, which should pass Travis after his PR
  is merged.
- Add "warn_unused_ignores" back to mypy's self-check config.

I confirmed that this PR passes tests both with and without the
lxml stubs being present.
@gvanrossum gvanrossum merged commit 735abe6 into python:master Nov 7, 2017
@JelleZijlstra JelleZijlstra deleted the removelxml branch November 7, 2017 16:01
JelleZijlstra added a commit to python/mypy that referenced this pull request Nov 7, 2017
@JelleZijlstra
Copy link
Member Author

Thanks Guido!

JelleZijlstra added a commit to python/mypy that referenced this pull request Nov 7, 2017
gvanrossum pushed a commit to python/mypy that referenced this pull request Nov 7, 2017
Followup from #4217 and python/typeshed#1664.

Also had to change a few types to `Any` because of the missing lxml stubs.
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.

3 participants