Skip to content

Poetry 2 compatibility #363

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

Closed
wants to merge 2 commits into from
Closed

Poetry 2 compatibility #363

wants to merge 2 commits into from

Conversation

dalito
Copy link
Member

@dalito dalito commented Jan 28, 2025

This only prepares for Poetry 2.0.x by removing old pins and changing the syntax to pass poetry check without warning for poetry 1.8.5.

With poetry 2.0.x there are warnings but no errors. So with the PR merged the project can be installed just fine with poetry 2.0.x.

The poetry 2.0 update of pyproject.toml will change more and should maybe done in another PR. Moreover, we may want to wait a little before breaking Poetry 1.8.x compatibility.

@dalito dalito marked this pull request as draft January 28, 2025 20:54
@dalito dalito force-pushed the poetry2-compat branch 2 times, most recently from 5d52204 to c1c2bcd Compare January 28, 2025 21:27
Copy link

codecov bot commented Jan 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.75%. Comparing base (1b5e9f7) to head (857efbe).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #363      +/-   ##
==========================================
- Coverage   63.43%   60.75%   -2.69%     
==========================================
  Files          63       62       -1     
  Lines        8982     8948      -34     
  Branches     2574     2569       -5     
==========================================
- Hits         5698     5436     -262     
+ Misses       2665     2661       -4     
- Partials      619      851     +232     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dalito dalito marked this pull request as ready for review January 28, 2025 21:36
Copy link
Contributor

@sneakers-the-rat sneakers-the-rat left a comment

Choose a reason for hiding this comment

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

I am not seeing the pass poetry check with a warning part, but if this patch allows CI to pass pending a full migration then looks good to me

run: pipx install poetry
# Pin to 1.8.5. because Poetry 2.0.0 installs plugins in a different way
# (dynamic versioning in next step)
run: pipx install poetry==1.8.5
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like there is a way to pin a specific version of poetry in pyproject.toml https://python-poetry.org/blog/announcing-poetry-2.0.0/

We may want to do a quick 1-line PR to upstream linkml to add this pin there rather than here so they don't go out of sync & fix later, but since this is likely to be a quick and easy change to both packages not necessary at all and this would be fine too

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe the option to constrain poetry was added only in 2.0 - I could not find it in 1.8.5.

@dalito
Copy link
Member Author

dalito commented Jan 29, 2025

I now think it is better to directly go to Poetry 2.0 fully.

Yesterday, I saw a failure locally which made me think that this fix is required but testing with a fresh checkout of the current main-branch shows that poetry check, poetry lock and poetry install work with 1.8.5 and 2.0.1 with warnings only.

@dalito dalito closed this Jan 29, 2025
@sneakers-the-rat
Copy link
Contributor

sounds good to me :) hopefully not too complicated, the 2.0 format is the standard anyway

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 this pull request may close these issues.

2 participants