Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

BUGFIX: Extending PYTHONPATH to fix local imports #863

Merged
merged 11 commits into from
Jul 30, 2018

Conversation

alexander-alvarez
Copy link
Contributor

@alexander-alvarez alexander-alvarez commented Jul 18, 2018

Issue Ref: Fixes #860 and #590

Description:
Adding PYTHONPATH environment variable so python files can import other python files. The 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 problem

EDIT: Extending the PYTHONPATH variable to also include the mount point for the assets

As 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 with hellowithdepshelper 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)?

  • Ready to review
  • Automated Tests
  • Docs
    not necessary, should be transparent to the users

@alexander-alvarez alexander-alvarez changed the title BUGFIX: Adding PYTHONPATH to fix local imports BUGFIX: Extending PYTHONPATH to fix local imports Jul 19, 2018
@alexander-alvarez
Copy link
Contributor Author

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!

@alexander-alvarez
Copy link
Contributor Author

@andresmgot do you have any cycles to look at this?

@arapulido
Copy link
Contributor

@alexander-alvarez thanks for the PR! We will look into this as soon as possible. Thanks!

@arapulido arapulido requested a review from andresmgot July 24, 2018 08:09
@andresmgot
Copy link
Contributor

Hi @alexander-alvarez this is a known issue since #590. Thank you for submitting a fix! The changes look good to me.

@andresmgot andresmgot merged commit 8beda89 into vmware-archive:master Jul 30, 2018
@alexander-alvarez alexander-alvarez deleted the fixup-python-path branch July 30, 2018 11:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants