Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lxml stubs for mypy #84

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion requirements/mypy/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions requirements/mypy/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tool.poetry.dependencies]
python = ">=3.8"
mypy = "*"
lxml-stubs = "*"
types-requests = "*"
types-toml = "*"

Expand Down
1 change: 1 addition & 0 deletions requirements/mypy/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
lxml-stubs==0.5.1 ; python_version >= "3.8"
mypy-extensions==1.0.0 ; python_version >= "3.8"
mypy==1.9.0 ; python_version >= "3.8"
tomli==2.0.1 ; python_version < "3.11" and python_version >= "3.8"
Expand Down
5 changes: 2 additions & 3 deletions src/listparser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
urllib3 = None # type: ignore[assignment]

try:
# lxml lacks mypy stubs at the time of writing.
import lxml.etree # type: ignore[import-untyped]
import lxml.etree
except ImportError:
lxml = None
lxml = None # type: ignore[assignment]

from . import common, foaf, igoogle, opml, xml_handler
from .exceptions import ListparserError
Expand Down