-
Notifications
You must be signed in to change notification settings - Fork 14
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
Impossible to use plugins following cli documentation #56
Comments
Hi @jredrejo, thanks for reporting this problem! We discussed a bit about it with @bmaher and it looks like we may want to generalize it: users probably don't want to install their plugins (or set My understanding is that all these should be possible (with an imaginary $ transformer -p mod.sub har/ >loc.py # "mod.sub" installed in PYTHONPATH
$ transformer -P ../../plugins/mod/sub.py har/ >loc.py # use an arbitrary Python file In the mean time, we should definitely update the documentation. Writing plugins § Name resolution already explains the catch:
But this should be made clearer and repeated, moved, or at least linked in Using plugins § Command-line usage as well. |
Installing the plugin in the python path works, but I won't use it until I have finished developing the plugin and do its python setup.py installation. However,
is not correct. If the plugin is in my current directory, it does not work either. Being in the same directory where I execute transformer I can execute without any problem Trying: $ transformer -p mod.sub har/ >kk.py works applying the code patch written in this issue description. |
Maybe related to #39. |
@thilp @jredrejo I thought we would be able to solve this with #39, but after my initial work on that it appears that loading of the plugins (i.e. the strategy) still relies on Transformer implementation. So we will have to handle the discovery of the modules anyway. That being said, I imagine there are different things we could do within this issue:
I suggest taking care of this separately and before #39 is fixed, mainly because #39 will introduce breaking changes to the current plugin system. I imagine that along with #39 we will warn about deprecating the old plugin system, and remove it altogether not long after that. It still make sense to support old plugin system, but only in the old versions of Transformer, so with limited scope. What do you think? If you agree, I encourage @jredrejo to create a PR with his suggested solution |
Describe the bug
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 if
mod/sub.py
andmod/__init__.py
files exist.However, it triggers this error
ERROR Failed loading plugins: No module named 'mod'
Transformer version
1.2.3
To Reproduce
Steps and input files to reproduce the behavior:
Expected behavior
Transformer should be able to find the plugin.
This is an easy fix for the problem:
but I am not sure if the intention of the project is providing this feature or change the docs to force to use plugins only after having been installed using pip, thus available in the sys.path.
In case the above solution is acceptable, I can fill a new PR, or feel free to use it.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: