Closed TomDeRybel closed 3 years ago
This is expected and documented behavior. You have conflicting namespaces: uavcan
and uavcan
.
Still having no luck.
mkdir ~/foobar
cd foobar
pyuavcan -v dsdl-gen-pkg ~/foobar --lookup https://github.com/UAVCAN/public_regulated_data_types/archive/master.zip
Still blows-up:
2020-11-03 15:30:47 12985 INFO pyuavcan._cli.commands.dsdl_generate_packages: Input DSDL root namespace directories: ['/home/tomr/foobar']
2020-11-03 15:30:47 12985 INFO pyuavcan._cli.commands.dsdl_generate_packages: Downloading the archive from 'https://github.com/UAVCAN/public_regulated_data_types/archive/master.zip' into '/tmp/pyuavcan-cli-dsdlhybgoa62/dsdl.zip'...
2020-11-03 15:30:47 12985 INFO pyuavcan._cli.commands.dsdl_generate_packages: Extracting the archive into '/tmp/pyuavcan-cli-dsdlhybgoa62'...
2020-11-03 15:30:47 12985 INFO pyuavcan._cli.commands.dsdl_generate_packages: Resource 'https://github.com/UAVCAN/public_regulated_data_types/archive/master.zip' contains the following root namespace directories: ['/tmp/pyuavcan-cli-dsdlhybgoa62/public_regulated_data_types-master/uavcan', '/tmp/pyuavcan-cli-dsdlhybgoa62/public_regulated_data_types-master/.vscode', '/tmp/pyuavcan-cli-dsdlhybgoa62/public_regulated_data_types-master/reg']
2020-11-03 15:30:47 12985 INFO pyuavcan._cli.commands.dsdl_generate_packages: Lookup DSDL root namespace directories: ['/tmp/pyuavcan-cli-dsdlhybgoa62/public_regulated_data_types-master/uavcan', '/tmp/pyuavcan-cli-dsdlhybgoa62/public_regulated_data_types-master/.vscode', '/tmp/pyuavcan-cli-dsdlhybgoa62/public_regulated_data_types-master/reg']
2020-11-03 15:30:47 12985 INFO pyuavcan._cli.commands.dsdl_generate_packages: Generating DSDL package PosixPath('/home/tomr/foobar/foobar') from root namespace PosixPath('/home/tomr/foobar') with lookup dirs: ['/tmp/pyuavcan-cli-dsdlhybgoa62/public_regulated_data_types-master/uavcan', '/tmp/pyuavcan-cli-dsdlhybgoa62/public_regulated_data_types-master/.vscode', '/home/tomr/foobar', '/tmp/pyuavcan-cli-dsdlhybgoa62/public_regulated_data_types-master/reg']
2020-11-03 15:30:47 12985 INFO pydsdl._namespace: The namespace at '/home/tomr/foobar' is empty
Error: ValueError: not enough values to unpack (expected 1, got 0)
2020-11-03 15:30:47 12985 INFO pyuavcan._cli._main: Unhandled exception: not enough values to unpack (expected 1, got 0)
Traceback (most recent call last):
File "/home/tomr/anaconda3/lib/python3.8/site-packages/pyuavcan/_cli/_main.py", line 24, in main
exit(_main_impl())
File "/home/tomr/anaconda3/lib/python3.8/site-packages/pyuavcan/_cli/_main.py", line 50, in _main_impl
result = args.func(args)
File "/home/tomr/anaconda3/lib/python3.8/site-packages/pyuavcan/_cli/_main.py", line 146, in execute
return cmd.execute(args, subsystems)
File "/home/tomr/anaconda3/lib/python3.8/site-packages/pyuavcan/_cli/commands/dsdl_generate_packages.py", line 111, in execute
gpi_list = self._generate_dsdl_packages(source_root_namespace_dirs=inputs,
File "/home/tomr/anaconda3/lib/python3.8/site-packages/pyuavcan/_cli/commands/dsdl_generate_packages.py", line 179, in _generate_dsdl_packages
gpi = pyuavcan.dsdl.generate_package(root_namespace_directory=ns,
File "/home/tomr/anaconda3/lib/python3.8/site-packages/pyuavcan/dsdl/_compiler.py", line 188, in generate_package
root_namespace_name, = set(map(lambda x: x.root_namespace, composite_types)) # type: str,
ValueError: not enough values to unpack (expected 1, got 0)
This is a duplicate of https://github.com/UAVCAN/pyuavcan/issues/130. Would you be inclined to submit a fix, perhaps? Otherwise, I should be able to get to it around the weekend.
The earliest I can take a look is Thursday (that is, if things go well tomorrow). I'll let you know by Friday if I can take this one on.
I took a good look at it, but decided to decline trying to fix this. The main reason is that I'm getting tangled-up in both the tools and (for me) non-trivial code base. It would take me quite a number of days to master all that and I am lacking the time to do that right now. Thus, if you could be so kind to take a look at this, I would be much obliged.
I'm trying to install and use pyuavcan-cli. It fails to generate the DSDL. These are the steps I took: