pythonstubs icon indicating copy to clipboard operation
pythonstubs copied to clipboard

PyStubbler is skipping namespaces and overwriting __init__.pyi

Open tinrobot2000 opened this issue 6 months ago • 0 comments

I am using the pystubbler to build the stubs for the Dynamo/Revit assembly ForgeUnitsCLI.dll (Typically located in C:\Program Files\Autodesk\Revit <year>\AddIns\DynamoForRevit directory for Revit versions >= 2023 and also present in the DynamoSandbox root directory) The assembly has three namespaces

image

I am able to generate the stubs by changing line 140 in StubBuilder.cs to i=0 this also avoids overwriting the __init__.pyi file in the root assembly folder

https://github.com/mcneel/pythonstubs/blob/98299771c9ff68157d657596020ed0019f2f3d94/builder/PyStubblerLib/StubBuilder.cs#L140

However I am finding that Pylance is now unable to resolve the Assembly unless I promote the namespace folders to my root autocomplete/stubs folder or adding the ForgeUnitsCLR directory to the python.autoComplete.extraPaths setting. ~I'm not across the Python type hinting syntax so any assistance would be appreciated~ Edit: Reading this -> https://typing.readthedocs.io/en/latest/ Is it possible the identical Assembly and namespace names are causing the bug?

tinrobot2000 avatar Aug 09 '24 09:08 tinrobot2000