File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838from ._support_wrappers import to_builtin as to_builtin
3939from ._support_wrappers import update_from_builtin as update_from_builtin
4040
41- from pycyphal .dsdl ._lockfile import Locker
42-
4341
4442def generate_package (* args , ** kwargs ): # type: ignore # pragma: no cover
4543 """Deprecated alias of :func:`compile`."""
Original file line number Diff line number Diff 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 (
You can’t perform that action at this time.
0 commit comments