Skip to content

Add an extra which specifies the lxml dependency #9105

Closed
@sirosen

Description

@sirosen

I'm aware of #909 , which indicates that mypy wants to remove the use of lxml altogether.
And in #1001, someone was suggesting making lxml a strict requirement. I don't want that either.

I think it would be preferable, for users managing their dependencies, to state mypy[report] or similar and have that extra pull in lxml.
i.e.

# test-requirements.txt

mypy
lxml<4

is less nice to work with than

# test-requirements.txt
mypy[report]

This is really just about letting users document their requirements better by means of the extra.
Yes, you can do it with comments, but I think the extra better encodes things.

I'd rather submit as an issue than come out with a PR because I have a bunch of questions.

  • Does mypy have a stance against extras? I see that the project doesn't use any today.
  • Is it an issue that mypy[report] might be supported by some, but not all, versions? (I've had cases where an extra sticks around, empty, until a major version bump, because you want to maintain compatibility for install commands.)
  • Is a move off of XML and XSLT imminent? (rendering this obsolete?)
  • Is there a better name? mypy[coverage]? mypy[xml]?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions