Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support plugins defined as inner classes #1318

Merged

Conversation

alexey-pelykh
Copy link
Contributor

@alexey-pelykh alexey-pelykh commented Mar 13, 2023

Support referencing the following plugin class by name and by type:

class Outer:
    class MyHttpProxyPlugin(HttpProxyPlugin):
        # ...

@alexey-pelykh alexey-pelykh force-pushed the imp/inner-plugin-classes branch from 91e7052 to f148568 Compare March 13, 2023 07:37
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided Used by chronographer to mark a PR as CHANGELOG provider label Mar 13, 2023
@abhinavsingh abhinavsingh self-requested a review March 13, 2023 15:17
@alexey-pelykh
Copy link
Contributor Author

Hm, I may need some insights on what have failed since:

Unable to find qualified name for module: check.py

tests/test_main.py

is there for me on unmodified develop as well

@abhinavsingh
Copy link
Owner

Hm, I may need some insights on what have failed since:

Unable to find qualified name for module: check.py

tests/test_main.py

is there for me on unmodified develop as well

Thank you @alexey-pelykh for this PR. These are possibly broken due to updated lint toolkit (in this case flake8 I suppose). At times upstream changes starts to show up as new lint errors in our repo :(. I'll address this in a separate PR and re-run/review this PR sometime morrow. Thanks again.

@abhinavsingh
Copy link
Owner

@alexey-pelykh I am fixing the lint issues via #1321 , we should be able to get going on this PR thereafter. Meanwhile, could you add a few lines about capabilities that this PR adds to the Loading Plugins section. This will allow others to also discover this magic :) https://github.com/abhinavsingh/proxy.py#loading-plugins

@abhinavsingh
Copy link
Owner

abhinavsingh commented Mar 14, 2023

@alexey-pelykh All looks good. Thank you again for your PR and included tests 🙏. Merging, we can update doc in a separate PR effort.

@abhinavsingh abhinavsingh merged commit f3d19ff into abhinavsingh:develop Mar 14, 2023
Copy link
Owner

@abhinavsingh abhinavsingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexey-pelykh alexey-pelykh deleted the imp/inner-plugin-classes branch March 14, 2023 14:38
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bot:chronographer:provided Used by chronographer to mark a PR as CHANGELOG provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants