Announcing Poetry 1.3.0

Published on December 9, 2022 in Releases with tags 1.X 1.3

The Poetry team is pleased to announce the immediate availability of Poetry 1.3.0.

If you have a previous version of Poetry installed via the official installer, getting Poetry 1.3.0 is as easy as:

$ poetry self update

Highlights #

New lock file format #

The lock file format has been changed to better support explicit sources. This change should be mostly transparent for users, as Poetry 1.2.2 or newer are capable of reading the new format, and Poetry 1.3.0 maintains full support for reading previous versions of the lock file format.

The lock file format had to be changed as previously filenames and hashes were locked in a global table. This could cause collisions with explicit sources or other more advanced uses of Poetry’s features, and the new format mitigates this by instead locking files with the corresponding metadata table.

Preventing cache corruption #

Poetry 1.1 and 1.2 are prone to corrupting various caches in the following common scenarios:

The former typically manifested as an indefinite hang while making HTTP requests, and should be prevented entirely on Poetry 1.3, regardless of the current state of your cache. This is because the fix has involved moving to a new file-locking implementation, and stale locks from the old implementation will be ignored. However, if you wish to explicitly clear this cache, you can do so with poetry cache clear --all ..

The latter improvement will not fix already-corrupted archives on disk; if you are experiencing hash mismatches, make sure to try clearing the artifacts cache with rm -rf $(poetry config cache-dir), and file a new issue if this still occurs on Poetry 1.3.

Upcoming Changes #

generate-setup-file = false #

Poetry has long generated a stub setup.py file for compatibility with older versions of pip (specifically, pip versions older than 19, the first to introduce support for PEP 517). Users who did not want Poetry to do this have long been able to opt out with the generate-setup-file option in tool.poetry.build.

The next minor release of Poetry will invert this behavior, turning off generation of setup.py by default. This change should be transparent to nearly all users, as versions of pip supporting alternate build systems natively have been available for nearly four years.

Users who wish to maintain the legacy behavior may explicitly do so in their pyproject.toml; however, users should keep in mind that this option will be deprecated and eventually removed in future versions of Poetry:

[tool.poetry.build]
generate-setup-file = true

Changelog #

Added #

Changed #

Fixed #

Docs #

poetry-core (1.4.0) #

poetry-plugin-export (^1.2.0) #

cleo (^2.0.0) #