Skip to content

Update Poetry description #496

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MarieRoald
Copy link
Contributor

Updates the description of Poetry to reflect their new support for PEP621.

Co-authored-by:  Yngve Mardal Moe <[email protected]>
@MarieRoald
Copy link
Contributor Author

Poetry does not have documented support for different build backends, so while we got it working with setuptools in some simple tests, there are still non-standard features in Poetry that won’t work with anything else (like grouping mandatory dependencies). There might also be other things that will break Poetry with other build backends, but we don’t know what they might be. We therefore didn’t update the summary table with whether or not it supports switching out the build backend.

Dependency specification |✅ |Poetry allows you to be specific about version of dependencies that you add to your package's pyproject.toml file. However, it's default upper bound approach can be problematic for some packages (We suggest you override the default setting when adding dependencies). Read below for more.
Environment management |✅ | Poetry allows you to either use its built in environment or you can select the environment type that you want to use for managing your package. [Read more about its built in environment management options](https://python-poetry.org/docs/basic-usage/#using-your-virtual-environment).
Lock files| ✅ | Poetry creates a **poetry.lock** file that you can use if you need a lock file for your build.
Publish to PyPI and test PyPI|✅|Poetry supports publishing to both test PyPI and PyPI
Version Control based versioning|✅ | The plugin [Poetry dynamic versioning](https://github.com/mtkennerly/poetry-dynamic-versioning) supports versioning using git tags with Poetry.
Version bumping| ✅ | Poetry supports you bumping the version of your package using standard semantic version terms patch; minor; major
Follows current packaging standards|✖✅|Poetry does not quite support current packaging standards for adding metadata to the **pyproject.toml** file but plans to fix this in an upcoming release.
Install your package in editable mode|✅|Poetry supports installing your package in editable mode using `--editable`
Follows current packaging standards|✖✅|Since version 2.0 (released January 2025), Poetry supports most current project metadata standards. However, not all standards are supported, and it also supports the legacy Poetry format. Read below for more.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this change justifies removing the

IMHO the timestamp is not needed. It is nice for now, but it seems like a task for cleanup in the year 2027 when no one remembers 1.X

Copy link
Member

Choose a reason for hiding this comment

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

We had a quick chat with Henry today @ucodery - my understanding is that poetry is doing a better job of supporting some standards, but not all. So I'm torn between the x/check combo because of that. Henry suggested that they still have ways to go. I haven't looked closely enough at Poetry lately to know what is still not following standards.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I realize that not all standards are followed, but my thinking was that often projects don't support every community standard; even more so when looking at historical versions. I didn't want to come back to this point every time Poetry does a minor version release and check if it is compliant enough to get a full check.
I would just note some of the bigger standards deviation in the Notes section, as is already done a bit. But if Henry thinks Poetry is still that far from an expected level of stardards following, I am also okay with leaving in the X.

Copy link
Member

Choose a reason for hiding this comment

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

heya @ucodery you make a good point. And I 1000% trust your thoughts here. I worry my last message sounded like Henry was directing the decision, or I was using that in some way. Please know that's not the case! We just had a chat, and that was a takeaway I had. Let's do what you suggest. Let's make it a check and then add a * with a note that the maintainer team is working toward PEP compliance. Does that sound reasonable? ✨

Copy link
Member

Choose a reason for hiding this comment

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

Actually, that statement in the table is super clear. Let's leave as is and just potentially (if @MarieRoald agrees) remove the x!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing the x is fine by me! (Btw, I co-authored this PR with @yngvem ✨)

@@ -408,11 +408,11 @@ Build your sdist and wheel distributions|✅|Poetry will build your sdist and wh

Some challenges of Poetry include:

- Poetry, by default, pins dependencies using an "upper bound" limit specified with the `^` symbol by default. However, this behavior can be over-written by specifying the dependency when you use `Poetry add` as follows: `poetry add "requests>=2.1"` See breakout below for more discussion on issues surrounding upper-bounds pinning.
- _Minor Challenge:_ The way Poetry currently adds metadata to your pyproject.toml file does not follow current Python standards. However, this is going to be addressed with Poetry release version 2.0.
- Poetry has its own concept of grouped dependencies (`poetry add --group=GROUP_NAME DEPENDENCY`). Dependencies added as grouped dependencies are not optional and there is no Python standard for this type of dependency. This should not be confused with "optional" dependencies (`poetry add --optional=GROUP_NAME DEPENDENCY`), which is standardised and lets you group your dependencies into several optional groups.
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 this is a great synopsis of Poetry's dependency flavours

Copy link
Collaborator

@willingc willingc left a comment

Choose a reason for hiding this comment

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

Thanks @MarieRoald and @yngvem for joining the sprint.

@willingc
Copy link
Collaborator

CI failure is an htmlproofer issue. The links to the Turing Way are valid.

@willingc
Copy link
Collaborator

Rerunning the build-test-book action in debug mode made things green.

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

Successfully merging this pull request may close these issues.

4 participants