You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the callback must be in the PYTHONPATH and is specified by "package.module:function" in the configuration. This is convenient when you already have the function in the Python path and the callback is part of a bigger project.
However, for one-off scripts it's more convenient to provide a path to the file (some/python/file.py:function) than it is to make a Python package for the callback alone.
We should add support to the consume CLI to accept a filesystem path as well as a Python path. It'll need to differentiate the two types. If a relative path is given to a file in the current directory (e.g. "callback.py:my_function") we can't tell the difference between the PYTHONPATH variety and the filesystem path, so I think we should always default to first trying the PYTHONPATH, then falling back to interpreting it as a filesystem path, then failing.
The text was updated successfully, but these errors were encountered:
Previously, the callback needed to reside on the Python Path, which is
convenient if you're already making a Python package. Plenty of folks
aren't, though, so allow users to provide a file that we'll boldly exec
and load a callback from.
Fixesfedora-infra#159
Signed-off-by: Jeremy Cline <jcline@redhat.com>
Previously, the callback needed to reside on the Python Path, which is
convenient if you're already making a Python package. Plenty of folks
aren't, though, so allow users to provide a file that we'll boldly exec
and load a callback from.
Fixes#159
Signed-off-by: Jeremy Cline <jcline@redhat.com>
Currently, the callback must be in the PYTHONPATH and is specified by "package.module:function" in the configuration. This is convenient when you already have the function in the Python path and the callback is part of a bigger project.
However, for one-off scripts it's more convenient to provide a path to the file (some/python/file.py:function) than it is to make a Python package for the callback alone.
We should add support to the consume CLI to accept a filesystem path as well as a Python path. It'll need to differentiate the two types. If a relative path is given to a file in the current directory (e.g. "callback.py:my_function") we can't tell the difference between the PYTHONPATH variety and the filesystem path, so I think we should always default to first trying the PYTHONPATH, then falling back to interpreting it as a filesystem path, then failing.
The text was updated successfully, but these errors were encountered: