Closed manishshettym closed 4 months ago
Solution: Move to something like "___" (triple underscore) which is valid for bash scripts and import statements, and rare enough to be used as a separator.
from AtsushiSakai|PythonRobotics_temp.PathPlanning.RRT.sobol.sobol import i4_sobol as sobol_quasirand
wait why is the import like this? it seems to be issue of import resolver?
accidental pipe is maybe a possible ig
@Naman-ntc: If we rename the repo (irrespective of the separator) and the root package directory is the root of the repo, then import transformations (relative to absolute) will (and should) show up like this.
E.g., of such a repo (where __init__.py is at topmost level) is https://github.com/AtsushiSakai/PythonRobotics
Hmm, we set the python path to be inside the repository folder right? So, i don't see why this is needed?
I would imagine that the __init__
at the topmost level is useful for using the package externally but within the repository using the repository folder name doesn't make sense (and original code skirts this by using relative paths ig)
So, i don't see why this is needed?
Hmm, not sure I understand. Do you mean we don't need to do relative->abs transformation? IIRC, it is for PyCG to not have issues finding stuff, right. Think removing that would be a breaking change for other repos(?)
If you mean this repo (PythonRobotics) is weird because it has a init.py under the repo's root (unlike the standard /src folder format for a package) -- I agree! and yes, that's the reason for this issue.
Side note: IMO, most reliable way to do rel->abs import transformation, is to use consistent imports from the root of the package
-- which in this case happens to be the repo folder.
Describe the bug setup_repos.py uses "|" as a separator between repo_org and repo_name when cloning new repos. This when passed to PyCG creates an error due to malformed import statements during transformations.
To Reproduce Steps to reproduce the behavior:
<any repo url>