Append current directory to the Python sys.path #63
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.
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 calledsub.py
located in themod
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
Adds the current path to the sys.path where Transformer can look for plugins
Review
2- Run Transformer with the -p python_path argument
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.