Skip to content
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

support for poetry 2? #11

Closed
aryarm opened this issue Jan 16, 2025 · 2 comments · Fixed by #12
Closed

support for poetry 2? #11

aryarm opened this issue Jan 16, 2025 · 2 comments · Fixed by #12

Comments

@aryarm
Copy link
Contributor

aryarm commented Jan 16, 2025

Hi @renan-r-santos,

First of all, thank you so much for creating this plugin. I've been using it in many of our projects for a while now, and it has been very useful!

I'm writing to inquire about the possibility of removing the poetry<2 upper bound requirement in the pyproject.toml file?

poetry = ">=1.3.0,<2"

I think most of the code is compatible with poetry 2.0. To check, I forked this repo and modified the CI to run pytest against poetry 2.0.1. After my changes (eb84c14...1adf781), the CI test completed successfully:

https://github.com/aryarm/poetry-conda/actions/runs/12815790474/job/35735262753

There was, however, one small change that I had to make!
The __init__() method in poetry's Config class appears to have changed recently. It has one fewer parameter. So I changed one of the methods in plugin.py:

super().__init__(use_environment, base_dir)

-        super().__init__(use_environment, base_dir)
+        try:
+            super().__init__(use_environment, base_dir)  # type: ignore
+        except TypeError:
+            super().__init__(use_environment)

Thanks in advance for any consideration of this!

@renan-r-santos
Copy link
Owner

Hi @aryarm, thank you for working on this. I'm very much open to supporting Poetry 2. I took a quick look and the changes look reasonable. Would you mind opening a PR? I'll review it and let you know if there are any further changes necessary, or, if you prefer, I could push those changes too.
Thanks

@aryarm
Copy link
Contributor Author

aryarm commented Jan 16, 2025

great! thank you 🙌

I'm happy to open a PR. In that case, I'll also revert my changes to the CI and lock file, since I'm not really sure if you want to test against poetry 2.0 in the same way that I did

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants