Python version specifiers and Dependency specifiers [Python Packaging Guide]

Compatible release: use ~=3.13.0 to mean any version of Python 3.13. Notably, don't use ~=3.13, which means Python 3.14, etc but not Python 4.

Semicolons are environments-specific constraints (called environment markers). E.g.

pywin32; sys_platform == 'win32' means only install pywin32 on Windows.

taskgroup; python =< '3.11' means to only install taskgroup when running on python 3.10 or earlier.

poetry-specific dependency specification

Caret ^ is not supported by standard Python packaging tools, but vaguely is the same as compatible (~=1) with the caveat the least significant version does not matter for setting a max supported version. E.g ^1.2.3 and ^1.2 both mean the max version is <2.0.0.

Tilde ~ is also not supported, but is more strict about the maximum version allowed. ~1.2.3 and ~1.2 both mean >=1.2.3,<1.3.0.

SamatsWiki: VersionSpecifiers (last edited 2025-07-31 17:28:44 by SamatJain)