Replies: 8 comments 12 replies
-
I love it! Please do the PR 😉 |
Beta Was this translation helpful? Give feedback.
-
@thomaspatzke I've made this PR a while ago. See if this is what you want to go forward with: #119. I listed the reasonings behind my decisions in the PR comments. |
Beta Was this translation helpful? Give feedback.
-
Cool! Thanks for your PR and sorry for let you waiting, was quite busy with various stuff. Some comments:
I'm thinking about possible solutions:
def autodiscover(f):
f.autodiscover = True
return f
@autodiscover
def pipeline():
...
I think it could be better to remove the warning because there can be functions for valid reasons. Because it's a breaking change I would introduce it in the 0.10 release, I have possibly another breaking change that could be accumulated there. |
Beta Was this translation helpful? Give feedback.
-
I would improve it as follows:
What do you think about this? |
Beta Was this translation helpful? Give feedback.
-
@thomaspatzke I made a new PR: |
Beta Was this translation helpful? Give feedback.
-
@thomaspatzke Is there anything else I need to do on this to make autodiscovery work more smoothly? Any ideas, discussions, etc.? |
Beta Was this translation helpful? Give feedback.
-
Hi all, is there also a way to "autodiscover" yaml pipelines? |
Beta Was this translation helpful? Give feedback.
-
Closing this as it seems all discussion points have been addressed. |
Beta Was this translation helpful? Give feedback.
-
Hey @thomaspatzke and the community,
I added a simple guide for migrating backends to support autodiscovery. Meanwhile I was talking with @kelnage about removing reliance on the backends to have module-level global variables for detection of backends and other relevant functions and classes. My proposal is that we can do this by enumerating objects exported by the module and checking if the object is a class and a subclass of the
Backend
class. It is much easier to show in the code:The autodiscovery method is calling
importlib.import_module
via the_discover_module_directories
private method, so why not just extract those classes while doing this via the above code.Feel free to disregard the suggestion if you've already considered this before.
WDYT?
P.S. I can do it in a PR if you are positive about this.
Beta Was this translation helpful? Give feedback.
All reactions