Search code examples
python-poetry

poetry update isn't updating a library even though there is one available


In my pyproject.toml I have

pyogrio = "^0.7.2"

Version 0.8.0 was released a week ago. Running poetry search pyogrio shows that 0.8.0 is available.

But running poetry update does not update it. Is this a problem with pyogrio?

Note I also have these libraries and constraints in pyproject.toml and they are updated when I run poetry update.

boto3 = "^1.34.58"
openai = "^1.23.6"

Output from poetry update

  - Updating boto3 (1.34.103 -> 1.34.106)
  - Updating openai (1.28.1 -> 1.30.1)

Note: manually changing to pyogrio = "^0.8.0" then running poetry install works... but surely I shouldn't have to do this?


Solution

  • ^0.7.2 is a shorthand for >=0.7.2,<0.8. (https://python-poetry.org/docs/dependency-specification/#caret-requirements)

    poetry update only updates the versions within the given version range. (https://python-poetry.org/docs/cli/#update)

    To upgrade a package to the latest version outside the version range run poetry add pyogrio@latest. (https://python-poetry.org/docs/cli/#add)