Skip to content

Commit

Permalink
fix: add missing dependency in xmllib (DEV-4254) (#1228)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum authored Oct 18, 2024
1 parent c1f78a2 commit 26bd3dc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependencies = [
"rustworkx>=0.15.1",
"termcolor>=2.4.0",
"tqdm>=4.66.5",
"typing-extensions>=4.12.2",
]


Expand Down
22 changes: 22 additions & 0 deletions test/distribution/test_xmllib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from dsp_tools.xmllib.models.dsp_base_resources import AnnotationResource
from dsp_tools.xmllib.models.resource import Resource
from dsp_tools.xmllib.models.root import XMLRoot
from dsp_tools.xmllib.value_checkers import is_bool_like
from dsp_tools.xmllib.value_converters import convert_to_bool_string


def test_xmllib() -> None:
"""
This does NOT test the xmllib.
This only tests if all dependencies used in the xmllib are shipped in the distribution.
For this purpose, it is enough to import all modules of the xmllib.
Indirect imports are okay, too, i.e. modules that are imported by modules that are imported here.
"""
root = XMLRoot("0000", "my_onto")
my_res = Resource.new("my_res", "restype", "label")
if is_bool_like("0"):
my_res.add_bool(convert_to_bool_string("0"), "my_prop")
my_res.add_file("my_file")
annotation = AnnotationResource.new("res_id", "label", "annotation_of", ["comment1", "comment2"])
root.add_resource(annotation) # type: ignore[arg-type]
root.add_resource(my_res)
2 changes: 2 additions & 0 deletions uv.lock

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

0 comments on commit 26bd3dc

Please sign in to comment.