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

Append current directory to the Python sys.path #63

Merged
merged 1 commit into from Oct 18, 2019

Conversation

jredrejo
Copy link
Contributor

Append current directory to the Python sys.path to allow using plugins that have not been installed using pypi

Closes #56

Description

According to https://github.com/zalando-incubator/Transformer/blob/master/docs/Using-plugins.rst, together with https://transformer.readthedocs.io/en/latest/Writing-plugins.html#name-resolution , when using the cli,
transformer -p mod.sub har/ >loc.py should work for a plugin called sub.py located in the mod directory.
However this didn't work unless the plugin has not been installed in the Python sys.path. Plugins left in the directory where transformer is executed are not found. Adding the current dir to the sys path fixes it.

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
    Adds the current path to the sys.path where Transformer can look for plugins

Review

  1. Anywhere in your system, creates a dummy.py plugin file
    2- Run Transformer with the -p python_path argument
  2. See error before appying this PR and see there's no error after this PR is applied

After this PR

Document at https://transformer.readthedocs.io/en/latest/Writing-plugins.html#name-resolution that this solves the problem when the plugin is in the current directory but not if it's somewhere else.

@zincr
Copy link

zincr bot commented Oct 17, 2019

🤖 zincr found 0 problems , 0 warnings

✅ Large Commits
✅ Approvals
✅ Specification
✅ Dependency Licensing

@tortila tortila merged commit 49a4e2e into zalando-incubator:master Oct 18, 2019
tortila added a commit that referenced this pull request Oct 18, 2019
Signed-off-by: Oliwia Zaremba <oliwiagolec@gmail.com>
tortila added a commit that referenced this pull request Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Impossible to use plugins following cli documentation
3 participants