Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enforce a minimum Python Poetry version?

I am using Python Poetry to manage dependencies in a Python project. I want to enforce a minimum Poetry version to avoid unnecessary changes in the poetry.lock file in version control.

I tried updating it in the [build-system] table of the pyproject.toml file but it works with lower versions as well.

Is there a way by which I can enforce a minimum Poetry version in a project?

like image 941
Sunil Kumar Avatar asked Jul 02 '26 18:07

Sunil Kumar


1 Answers

This can be done with the following notation in pyproject.toml:

[tool.poetry]
requires-poetry = ">=2.0.0"

This feature was added in this change and released in Poetry version 2.0.0 on 2025-01-05. Here is the documentation.

like image 185
Vetsin Avatar answered Jul 05 '26 08:07

Vetsin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!