This repository has been archived by the owner on Dec 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 753
BUGFIX: Extending PYTHONPATH to fix local imports #863
Merged
andresmgot
merged 11 commits into
vmware-archive:master
from
alexander-alvarez:fixup-python-path
Jul 30, 2018
Merged
BUGFIX: Extending PYTHONPATH to fix local imports #863
andresmgot
merged 11 commits into
vmware-archive:master
from
alexander-alvarez:fixup-python-path
Jul 30, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TODO: necessary for 2.7? How do we test that this is ok with respect to the mount point?
This reverts commit 6da1fba.
alexander-alvarez
changed the title
BUGFIX: Adding PYTHONPATH to fix local imports
BUGFIX: Extending PYTHONPATH to fix local imports
Jul 19, 2018
Sorry for all the commit noise -- I couldn't actually test this out on my local environment due to issues getting minikube / virtual machines working on my machine, so I had to use CI to test the changes, which led to a slew of commits. From my end I believe, this PR is g2g and ready for review! |
@andresmgot do you have any cycles to look at this? |
@alexander-alvarez thanks for the PR! We will look into this as soon as possible. Thanks! |
Hi @alexander-alvarez this is a known issue since #590. Thank you for submitting a fix! The changes look good to me. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Ref: Fixes #860 and #590
Description:
AddingThe current setup is broken because the python program is not run from the directory of the project files. Adding the mount directory to the python path should alleviate this problemPYTHONPATH
environment variable so python files can import other python files.EDIT: Extending the
PYTHONPATH
variable to also include the mount point for the assetsAs a failing test case, I made
examples/python/hellowithdeps.py
pull it's implementation of foo from a local file, as such I needed to make the deploy function send up a zip with both files instead of just the single python file. Before, this would fail withhellowithdepshelper not found
, the modified test demonstrates it passing.TODOs:
Necessary for 2.7? How do we test that this is ok with respect to the mount point (/kubeless
)?not necessary, should be transparent to the users