While exclude_dirs supplied to build_nim_extensions() clearly should be a list, it would seem excusable for a user to specify it as a set in the light that _find_extensions() does:
Unfortunately, one then gets the following cryptic error:
Traceback (most recent call last):
File "setup.py", line 9, in
modules = nimporter.build_nim_extensions(exclude_dirs={})
File "/home/phdyex/.local/lib/python3.8/site-packages/nimporter.py", line 1081, in build_nim_extensions
ext = cls._build_nim_extension(extension, root)
File "/home/phdyex/.local/lib/python3.8/site-packages/nimporter.py", line 979, in _build_nim_extension
return NimCompiler.compile_nim_extension(
File "/home/phdyex/.local/lib/python3.8/site-packages/nimporter.py", line 465, in compile_nim_extension
raise NimCompileException(errors[0])
nimporter.NimCompileException: type mismatch: got <int literal(5), int literal(5)>
| if exp[i].kind in nnkCallKinds + {nnkDotExpr, nnkBracketExpr}:
| let callVar = newIdentNode(":c" & $counter)
-> result.assigns.add getAst(asgn(callVar, paramAst))
| result.check[i] = callVar
| result.printOuts.add getAst(print(argStr, callVar))
At /home/phdyex/.choosenim/toolchains/nim-1.2.0/lib/pure/unittest.nim 650:43
I will create a PR to catch this scenario and raise an informative exception.
While exclude_dirs supplied to build_nim_extensions() clearly should be a list, it would seem excusable for a user to specify it as a set in the light that _find_extensions() does:
Unfortunately, one then gets the following cryptic error: Traceback (most recent call last): File "setup.py", line 9, in
modules = nimporter.build_nim_extensions(exclude_dirs={})
File "/home/phdyex/.local/lib/python3.8/site-packages/nimporter.py", line 1081, in build_nim_extensions
ext = cls._build_nim_extension(extension, root)
File "/home/phdyex/.local/lib/python3.8/site-packages/nimporter.py", line 979, in _build_nim_extension
return NimCompiler.compile_nim_extension(
File "/home/phdyex/.local/lib/python3.8/site-packages/nimporter.py", line 465, in compile_nim_extension
raise NimCompileException(errors[0])
nimporter.NimCompileException: type mismatch: got <int literal(5), int literal(5)>
| if exp[i].kind in nnkCallKinds + {nnkDotExpr, nnkBracketExpr}:
| let callVar = newIdentNode(":c" & $counter)
-> result.assigns.add getAst(asgn(callVar, paramAst))
| result.check[i] = callVar
| result.printOuts.add getAst(print(argStr, callVar))
At /home/phdyex/.choosenim/toolchains/nim-1.2.0/lib/pure/unittest.nim 650:43
I will create a PR to catch this scenario and raise an informative exception.