-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
What would you need to stop monkeypatching poetry.core
?
#175
Comments
Hi! Thanks for reaching out. The biggest thing would be for Poetry Core to support plugins. poetry-dynamic-versioning uses the build backend wrapper and monkey patching in order to work with Poetry Core even when Poetry itself isn't present. Aside from that, it would be nice to have an API to tell Poetry that the plugin is changing certain fields from pyproject.toml. Right now, the plugin has to modify a couple of private fields: poetry-dynamic-versioning/poetry_dynamic_versioning/plugin.py Lines 98 to 99 in 1162595
As a general solution, I'd like the plugin API to have a function like:
Poetry would load the initial pyproject.toml and pass it to each plugin sequentially, giving each plugin a chance to change the config (either by mutation or returning a modified copy). Once all modifications are accumulated, Poetry would replace its internal state based on those changes. I'd also want the modified data to end up in the sdist/wheel's pyproject.toml. |
Another thing is that this plugin also needs to handle dependencies, not just the main project, since dependencies could also be relying on the plugin for versioning (mainly path/Git dependencies). We also use monkey patching for that: poetry-dynamic-versioning/poetry_dynamic_versioning/plugin.py Lines 49 to 55 in 1162595
I'm not sure if it's better to call the hypothetical |
@Secrus , @mtkennerly , hello. Any progress with this issue? Could you give more details? |
@stankudrow not from my side. This is still on the roadmap, but time is limited and there are different priorities too. |
Glad to hear it's still on the roadmap :) I'd be happy to help test out any changes when it's ready. |
Hi! I am part of the Poetry core team and actively looking into our plugin API. I am wondering, what would be your "wishlist" of options/APIs you would need to stop monkeypatching
poetry.core
and replacing the build backend?The text was updated successfully, but these errors were encountered: