Skip to content

Conversation

@robd518
Copy link
Contributor

@robd518 robd518 commented Nov 10, 2025

Fixes #7090

📝 Summary

Poetry 1.x and 2.x handle the poetry show command differently. The current PoetryPackageManager implementation is fine but with the release of Poetry 2.0 in January the current implementation breaks. This PR will fix issue #7090 - and as a side benefit - improve the PoetryPackageManager class.

🔍 Description of Changes

Poetry version detection:

The manager now detects the installed Poetry version (1.x vs 2.x) at runtime.

Adaptive command generation:

  • For Poetry 1.x, use poetry show --no-dev.
    • If no dev dependencies exist, this command still succeeds.
  • For Poetry 2.x, attempt poetry show --without dev.
    • If the command succeeds, we use its output.
    • If it fails with Group(s) not found, this indicates that no dev group is defined — in that case, fall back to poetry show to capture all installed packages.

Fallback behavior:

If version detection or command inference fails for any reason, default gracefully to poetry show.

This ensures PoetryPackageManager works consistently across Poetry versions 1.x → 2.x and avoids breaking when no dependency groups are defined.

📋 Checklist

  • I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • I have added tests for the changes made.
  • I have run the code and verified that it works as expected.

@robd518 robd518 requested a review from dmadisetti as a code owner November 10, 2025 21:40
@robd518
Copy link
Contributor Author

robd518 commented Nov 10, 2025

I have read the CLA Document and I hereby sign the CLA

@vercel
Copy link

vercel bot commented Nov 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
marimo-docs Ready Ready Preview Comment Nov 15, 2025 9:26pm

Copy link
Collaborator

@dmadisetti dmadisetti left a comment

Choose a reason for hiding this comment

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

Thanks for the tests! LGTM

Copy link
Collaborator

@dmadisetti dmadisetti left a comment

Choose a reason for hiding this comment

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

Actually, would you mind grabbing the lint errors that popped up? You can run make py-check locally? Also left a suggestion if you just want to apply that, but needs an additional change to go with

@robd518
Copy link
Contributor Author

robd518 commented Nov 12, 2025

Hey @dmadisetti 👋 I think I've handled them but please let me know. I'm still trying to familiarize myself with the dev environment so let me know if there's something I'm missing!

image

@robd518 robd518 requested a review from dmadisetti November 12, 2025 20:53
@dmadisetti
Copy link
Collaborator

@robd518 I think that was the only issue (which is now fine)
I'm good with this once we handle the -1 !!
Thanks! Hope this has been working for you

@robd518
Copy link
Contributor Author

robd518 commented Nov 13, 2025

@dmadisetti If you're referring to this line, I believe it's committed and ready to go but let me know if you're seeing seomthing different or if I'm just missing something. :)

@mscolnick mscolnick changed the title Rd/issue 7090 poetry package list improvement: poetry package list support for v2 Nov 13, 2025
Copy link
Collaborator

@dmadisetti dmadisetti left a comment

Choose a reason for hiding this comment

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

Hey, sorry this slipped. LGTM

@dmadisetti dmadisetti added the enhancement New feature or request label Nov 20, 2025
@dmadisetti dmadisetti merged commit f5eb28e into marimo-team:main Nov 20, 2025
33 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Poetry 2.x causes the package manager to show an empty list in the sidebar

2 participants