Skip to content

Commit

Permalink
Merge branch 'master' into python3_str
Browse files Browse the repository at this point in the history
  • Loading branch information
scoder authored Jan 2, 2024
2 parents b3e36fd + 67097e5 commit fb6ccee
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include setup.py pyproject.toml tox.ini MANIFEST.in Makefile
include LICENSE README.md
recursive-include lxml-stubs *.pyi
recursive-include test-data *.yml
10 changes: 7 additions & 3 deletions lxml-stubs/etree.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ from typing import (
overload,
)

from typing_extensions import Literal, Protocol, TypeAlias, TypeGuard
from typing_extensions import Literal, Protocol, SupportsIndex, TypeAlias, TypeGuard

# dummy for missing stubs
def __getattr__(name: str) -> Any: ...
Expand Down Expand Up @@ -137,6 +137,10 @@ class DocInfo:
class _Element(Iterable["_Element"], Sized):
def __delitem__(self, key: Union[int, slice]) -> None: ...
def __getitem__(self, item: int) -> _Element: ...
@overload
def __setitem__(self, __key: SupportsIndex, value: _Element) -> None: ...
@overload
def __setitem__(self, __key: slice, value: Iterable[_Element]) -> None: ...
def __iter__(self) -> ElementChildIterator: ...
def __len__(self) -> int: ...
def addprevious(self, element: "_Element") -> None: ...
Expand Down Expand Up @@ -503,7 +507,7 @@ def SubElement(
def ElementTree(
element: _Element = ...,
file: _FileSource = ...,
parser: _AnyParser = ...,
parser: Optional[_AnyParser] = ...,
) -> _ElementTree: ...
def ProcessingInstruction(
target: _StrOrBytes, text: Optional[_StrOrBytes] = ...
Expand All @@ -528,7 +532,7 @@ def cleanup_namespaces(
) -> None: ...
def parse(
source: _FileSource,
parser: _AnyParser = ...,
parser: Optional[_AnyParser] = ...,
base_url: _StrOrBytes = ...,
) -> Union[_ElementTree, Any]: ...
@overload
Expand Down
10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@
description="Type annotations for the lxml package",
long_description=long_description,
long_description_content_type="text/markdown",

author="lxml dev team",
author_email="[email protected]",
maintainer="lxml dev team",
maintainer_email="[email protected]",
url="https://github.com/lxml/lxml-stubs",

package_data={"lxml-stubs": ["*.pyi", "*/*.pyi"]},
packages=["lxml-stubs"],
tests_require=tests_require,
extras_require={"test": tests_require},
zip_safe=False,

classifiers=[
"License :: OSI Approved :: Apache Software License",
],
zip_safe=False
)

0 comments on commit fb6ccee

Please sign in to comment.