Skip to content

Commit 657d727

Browse files
committed
address comments
1 parent adacb45 commit 657d727

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

pycyphal/dsdl/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
from ._support_wrappers import to_builtin as to_builtin
3939
from ._support_wrappers import update_from_builtin as update_from_builtin
4040

41-
from pycyphal.dsdl._lockfile import Locker
42-
4341

4442
def generate_package(*args, **kwargs): # type: ignore # pragma: no cover
4543
"""Deprecated alias of :func:`compile`."""

pycyphal/dsdl/_compiler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,12 @@ def compile( # pylint: disable=redefined-builtin
143143
# https://forum.opencyphal.org/t/nestedrootnamespaceerror-in-basic-usage-demo/794
144144
raise TypeError(f"Lookup directories shall be an iterable of paths, not {type(lookup_directories).__name__}")
145145

146+
output_directory = pathlib.Path(pathlib.Path.cwd() if output_directory is None else output_directory).resolve()
147+
146148
language_context = nunavut.lang.LanguageContextBuilder().set_target_language("py").create()
147149

148150
root_namespace_name: str = ""
149151
composite_types: list[pydsdl.CompositeType] = []
150-
output_directory = pathlib.Path(pathlib.Path.cwd() if output_directory is None else output_directory).resolve()
151152

152153
if root_namespace_directory is not None:
153154
root_namespace_directory = pathlib.Path(root_namespace_directory).resolve()
@@ -185,11 +186,10 @@ def compile( # pylint: disable=redefined-builtin
185186
)
186187

187188
lockfile = Locker(
188-
root_namespace_name=root_namespace_name if root_namespace_name else "support",
189+
root_namespace_name=root_namespace_name if root_namespace_name else "_support_",
189190
output_directory=output_directory,
190191
)
191-
lockfile_created = lockfile.create()
192-
if lockfile_created:
192+
if lockfile.create():
193193
# Generate code
194194
assert isinstance(output_directory, pathlib.Path)
195195
code_generator = nunavut.jinja.DSDLCodeGenerator(

0 commit comments

Comments
 (0)