-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from inab/jmfernandez
Reimplemented the export machinery and version bump to 0.10.0
- Loading branch information
Showing
72 changed files
with
13,000 additions
and
2,015 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
[pytest] | ||
pythonpath = . | ||
testpaths = tests | ||
required_plugins = pytest_param_files | ||
addopts = --order-dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,10 @@ pylint < 2.14.0 ; python_version == '3.6' | |
pylint >= 2.15.5 ; python_version >= '3.7' | ||
pytest | ||
pytest-cov | ||
pytest-dependency @ git+https://github.com/jmfernandez/[email protected] | ||
pytest-env | ||
pytest-order | ||
pytest_param_files | ||
pytest-xdist | ||
pyflakes >= 2.5.0 | ||
flake8 < 6.0.0 ; python_version < '3.8' | ||
|
4,226 changes: 3,148 additions & 1,078 deletions
4,226
development-docs/wfexs-analysis-lifecycle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
from collections.abc import Iterator, Sequence | ||
from typing import Any | ||
from _typeshed import SupportsRead | ||
from xml.etree.ElementTree import ( | ||
Element, | ||
ElementTree, | ||
ParseError as ParseError, | ||
TreeBuilder as _TreeBuilder, | ||
XMLParser as _XMLParser, | ||
tostring as tostring, | ||
) | ||
|
||
class DefusedXMLParser(_XMLParser): | ||
forbid_dtd: bool | ||
forbid_entities: bool | ||
forbid_external: bool | ||
def __init__( | ||
self, | ||
html: object | bool = ..., | ||
target: _TreeBuilder | None = None, | ||
encoding: str | None = None, | ||
forbid_dtd: bool = False, | ||
forbid_entities: bool = True, | ||
forbid_external: bool = True, | ||
) -> None: ... | ||
def defused_start_doctype_decl( | ||
self, | ||
name: str | None, | ||
sysid: str | None, | ||
pubid: str | None, | ||
has_internal_subset: bool, | ||
) -> None: ... | ||
def defused_entity_decl( | ||
self, | ||
name: str | None, | ||
is_parameter_entity: bool, | ||
value: str | None, | ||
base: str | None, | ||
sysid: str | None, | ||
pubid: str | None, | ||
notation_name: str | None, | ||
) -> None: ... | ||
def defused_unparsed_entity_decl( | ||
self, | ||
name: str | None, | ||
base: str | None, | ||
sysid: str | None, | ||
pubid: str | None, | ||
notation_name: str | None, | ||
) -> None: ... | ||
def defused_external_entity_ref_handler( | ||
self, | ||
context: str | None, | ||
base: str | None, | ||
sysid: str | None, | ||
pubid: str | None, | ||
) -> None: ... | ||
|
||
XMLTreeBuilder = DefusedXMLParser | ||
XMLParse = DefusedXMLParser | ||
XMLParser = DefusedXMLParser | ||
|
||
# wrapper to xml.etree.ElementTree.parse | ||
def parse( | ||
source: str | SupportsRead[bytes] | SupportsRead[str], | ||
parser: _XMLParser | None = None, | ||
forbid_dtd: bool = False, | ||
forbid_entities: bool = True, | ||
forbid_external: bool = True, | ||
) -> ElementTree: ... | ||
|
||
# wrapper to xml.etree.ElementTree.iterparse | ||
def iterparse( | ||
source: str | SupportsRead[bytes] | SupportsRead[str], | ||
events: Sequence[str] | None = None, | ||
parser: _XMLParser | None = None, | ||
forbid_dtd: bool = False, | ||
forbid_entities: bool = True, | ||
forbid_external: bool = True, | ||
) -> Iterator[tuple[str, Any]]: ... | ||
def fromstring( | ||
text: str, | ||
forbid_dtd: bool = False, | ||
forbid_entities: bool = True, | ||
forbid_external: bool = True, | ||
) -> Element: ... | ||
|
||
XML = fromstring | ||
|
||
__all__ = [ | ||
"ParseError", | ||
"XML", | ||
"XMLParse", | ||
"XMLParser", | ||
"XMLTreeBuilder", | ||
"fromstring", | ||
"iterparse", | ||
"parse", | ||
"tostring", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version = "0.7.*" | ||
upstream_repository = "https://github.com/tiran/defusedxml" | ||
partial_stub = true | ||
|
||
[tool.stubtest] | ||
ignore_missing_stub = true | ||
stubtest_requirements = ["lxml"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from .common import ( | ||
DefusedXmlException as DefusedXmlException, | ||
DTDForbidden as DTDForbidden, | ||
EntitiesForbidden as EntitiesForbidden, | ||
ExternalReferenceForbidden as ExternalReferenceForbidden, | ||
NotSupportedError as NotSupportedError, | ||
) | ||
|
||
__all__ = [ | ||
"DefusedXmlException", | ||
"DTDForbidden", | ||
"EntitiesForbidden", | ||
"ExternalReferenceForbidden", | ||
"NotSupportedError", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from .ElementTree import ( | ||
XML as XML, | ||
ParseError as ParseError, | ||
XMLParse as XMLParse, | ||
XMLParser as XMLParser, | ||
XMLTreeBuilder as XMLTreeBuilder, | ||
fromstring as fromstring, | ||
iterparse as iterparse, | ||
parse as parse, | ||
tostring as tostring, | ||
) | ||
|
||
__all__ = [ | ||
"ParseError", | ||
"XML", | ||
"XMLParse", | ||
"XMLParser", | ||
"XMLTreeBuilder", | ||
"fromstring", | ||
"iterparse", | ||
"parse", | ||
"tostring", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
PY3: bool | ||
|
||
class DefusedXmlException(ValueError): ... | ||
|
||
class DTDForbidden(DefusedXmlException): | ||
name: str | None | ||
sysid: str | None | ||
pubid: str | None | ||
def __init__( | ||
self, name: str | None, sysid: str | None, pubid: str | None | ||
) -> None: ... | ||
|
||
class EntitiesForbidden(DefusedXmlException): | ||
name: str | None | ||
value: str | None | ||
base: str | None | ||
sysid: str | None | ||
pubid: str | None | ||
notation_name: str | None | ||
def __init__( | ||
self, | ||
name: str | None, | ||
value: str | None, | ||
base: str | None, | ||
sysid: str | None, | ||
pubid: str | None, | ||
notation_name: str | None, | ||
) -> None: ... | ||
|
||
class ExternalReferenceForbidden(DefusedXmlException): | ||
context: str | None | ||
base: str | None | ||
sysid: str | None | ||
pubid: str | None | ||
def __init__( | ||
self, | ||
context: str | None, | ||
base: str | None, | ||
sysid: str | None, | ||
pubid: str | None, | ||
) -> None: ... | ||
|
||
class NotSupportedError(DefusedXmlException): ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
from _typeshed import SupportsRead | ||
from xml.dom.expatbuilder import ( | ||
ExpatBuilder as _ExpatBuilder, | ||
Namespaces as _Namespaces, | ||
) | ||
from xml.dom.minidom import Document | ||
from xml.dom.xmlbuilder import Options | ||
|
||
__origin__: str | ||
|
||
class DefusedExpatBuilder(_ExpatBuilder): | ||
forbid_dtd: bool | ||
forbid_entities: bool | ||
forbid_external: bool | ||
def __init__( | ||
self, | ||
options: Options | None = None, | ||
forbid_dtd: bool = False, | ||
forbid_entities: bool = True, | ||
forbid_external: bool = True, | ||
) -> None: ... | ||
def defused_start_doctype_decl( | ||
self, name, sysid, pubid, has_internal_subset | ||
) -> None: ... | ||
def defused_entity_decl( | ||
self, name, is_parameter_entity, value, base, sysid, pubid, notation_name | ||
) -> None: ... | ||
def defused_unparsed_entity_decl( | ||
self, name, base, sysid, pubid, notation_name | ||
) -> None: ... | ||
def defused_external_entity_ref_handler( | ||
self, context, base, sysid, pubid | ||
) -> None: ... | ||
def install(self, parser) -> None: ... | ||
|
||
class DefusedExpatBuilderNS(_Namespaces, DefusedExpatBuilder): | ||
def install(self, parser) -> None: ... | ||
def reset(self) -> None: ... | ||
|
||
def parse( | ||
file: str | SupportsRead[bytes | str], | ||
namespaces: bool = True, | ||
forbid_dtd: bool = False, | ||
forbid_entities: bool = True, | ||
forbid_external: bool = True, | ||
) -> Document: ... | ||
def parseString( | ||
string: str, | ||
namespaces: bool = True, | ||
forbid_dtd: bool = False, | ||
forbid_entities: bool = True, | ||
forbid_external: bool = True, | ||
) -> Document: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from _typeshed import Incomplete | ||
|
||
# Cannot type most things here as DefusedExpatParser is based off of | ||
# xml.sax.expatreader, which is an undocumented module and lacks types at the moment. | ||
|
||
__origin__: str | ||
|
||
DefusedExpatParser = Incomplete | ||
|
||
def create_parser(*args, **kwargs): ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import threading | ||
from _typeshed import Incomplete | ||
|
||
# Not bothering with types here as lxml support is supposed to be dropped in a future version | ||
# of defusedxml | ||
|
||
LXML3: Incomplete | ||
__origin__: str | ||
tostring: Incomplete | ||
|
||
# Should be imported from lxml.etree.ElementBase, but lxml lacks types | ||
class _ElementBase: ... | ||
|
||
class RestrictedElement(_ElementBase): | ||
blacklist: Incomplete | ||
def __iter__(self): ... | ||
def iterchildren(self, tag: Incomplete | None = ..., reversed: bool = ...): ... | ||
def iter(self, tag: Incomplete | None = ..., *tags): ... | ||
def iterdescendants(self, tag: Incomplete | None = ..., *tags): ... | ||
def itersiblings(self, tag: Incomplete | None = ..., preceding: bool = ...): ... | ||
def getchildren(self): ... | ||
def getiterator(self, tag: Incomplete | None = ...): ... | ||
|
||
class GlobalParserTLS(threading.local): | ||
parser_config: Incomplete | ||
element_class: Incomplete | ||
def createDefaultParser(self): ... | ||
def setDefaultParser(self, parser) -> None: ... | ||
def getDefaultParser(self): ... | ||
|
||
getDefaultParser: Incomplete | ||
|
||
def check_docinfo( | ||
elementtree, forbid_dtd: bool = ..., forbid_entities: bool = ... | ||
) -> None: ... | ||
def parse( | ||
source, | ||
parser: Incomplete | None = ..., | ||
base_url: Incomplete | None = ..., | ||
forbid_dtd: bool = ..., | ||
forbid_entities: bool = ..., | ||
): ... | ||
def fromstring( | ||
text, | ||
parser: Incomplete | None = ..., | ||
base_url: Incomplete | None = ..., | ||
forbid_dtd: bool = ..., | ||
forbid_entities: bool = ..., | ||
): ... | ||
|
||
XML = fromstring | ||
|
||
def iterparse(*args, **kwargs) -> None: ... |
Oops, something went wrong.