Closed PeterJCLaw closed 1 year ago
Indeed. The .pyi
file is useful to ensure that mypy
correctly handles the namespace packages (or it certainly used to be needed, that may have been fixed).
Indeed. The
.pyi
file is useful to ensure thatmypy
correctly handles the namespace packages (or it certainly used to be needed, that may have been fixed).
I think there's a --namespace-packages arg for mypy to handle that. We use it for sr.robot3
If using the same Python environment to run e.g: SRComp (which installs to
sr.comp
) as the one you want to use for running the simulator then thesr.robot3
package will not be found even though it is correctly onPYTHONPATH
.The fix seems to be to change
modules/sr/__init__.py
tomodules/sr/__init__.pyi
. This changes the package being an implicit namespace package, which is compatible with SRComp at least.