Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packager directory fix #507

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions source/python/neuropod/backends/python/packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ def addition_model(x, y):
for copy_spec in code_path_spec:
python_root = copy_spec["python_root"]

if os.path.realpath(neuropod_path).startswith(
#Ensures that neuropod_path is not a subdirectory of python_root
#Ensures neuropod_path and python_root are not the same directory
if os.path.samefile(neuropod_path,python_root) or os.path.realpath(neuropod_path).startswith(
os.path.realpath(python_root) + os.sep
):
raise ValueError(
"`neuropod_path` cannot be a subdirectory of `python_root`"
"`neuropod_path` cannot be the same directory as `python_root' or a subdirectory of `python_root`."
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you run lint locally to check formatting and code style?

From https://neuropod.ai/docs/stable/developing/#lint-and-static-analysis:

To show all lint errors and warnings locally, you can run ./tools/lint.sh. To attempt to automatically fix any issues that can be automatically fixed, run ./tools/autofix.sh.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not run lint. The link to the lint description in the contributions guidelines and did not open to the page you added when i tried to open it.


for dir_to_package in copy_spec["dirs_to_package"]:
Expand Down