uber/neuropod

Make sure `python_root` and `neuropod_path` are not the same

VivekPanyam opened this issue · 5 comments

This check currently ensures that neuropod_path is not a subdirectory of python_root. However, it misses cases where they are the same directory

https://github.com/uber/neuropods/blob/9c4b58b84429b4390e8dfa658963d65312b6b52c/source/neuropods/python/backends/python/packager.py#L152-L153

Relevant lines are now

if os.path.realpath(neuropod_path).startswith(
os.path.realpath(python_root) + os.sep
):
raise ValueError(
"`neuropod_path` cannot be a subdirectory of `python_root`"
)

Hi can I get some guidance to work on this issue ?

If this issue is still open can i work on it?

Proposed solution:
Add

os.path.samefile(neuropod_path,python_root) 

to the if statement

If this issue is still open can i work on it?

Proposed solution:
Add

os.path.samefile(neuropod_path,python_root) 

to the if statement

Hi @nemanjarajic! The proposed solution looks good to me! If you haven't already, read through these docs on building and testing Neuropod to help you get started locally. Also it might be helpful to take a look at the contributing guidelines as well. Feel free to comment here if you run into any issues!

@VivekPanyam

Sounds good. I followed the contributing guidelines and added the proposed solution to packager.py file. Now I am just waiting on the docker build to complete, so I can include the tests to the PR.