The current Python version (3.10.12) is not compatible with the required Python version (^3.9) – Poetry lock file omits patch version
0 reputation · 18 Sept 2024, 17:07 UTC
Poetry’s lock file guarantees reproducibility of dependencies but records only the major.minor portion of the Python version constraint (e.g., ^3.10). When the lock file is generated, the exact patch that was active is not stored. Consequently, poetry install will succeed on any Python 3.10.x instance, even if the patch introduces subtle behavior changes.
This omission creates a latent source of non‑repeatable builds: two developers using different patch releases of the same major.minor version may obtain subtly different runtime environments, while Poetry reports no error. The tool’s documentation acknowledges this limitation, leaving the decision to enforce patch pinning to external tooling.
Given this design choice, we face several open questions:
- Should Poetry extend its lock file format to record the full Python patch version for stricter reproducibility?
- What mechanisms (e.g., pyenv, Docker, or explicit
python = "3.10.12"inpyproject.toml) best enforce patch‑level consistency across environments? - How might patch‑level variation affect dependency resolution and the overall reliability of Poetry‑managed projects?