Skip to content

fix: parse PEP 440 pre-release versions in compat module#318

Open
ericbuehl wants to merge 1 commit into
dapper91:masterfrom
ericbuehl:fix/version-parsing-prerelease
Open

fix: parse PEP 440 pre-release versions in compat module#318
ericbuehl wants to merge 1 commit into
dapper91:masterfrom
ericbuehl:fix/version-parsing-prerelease

Conversation

@ericbuehl
Copy link
Copy Markdown

tuple(map(int, pd.version.partition('+')[0].split('.'))) raised ValueError on valid pre-release version strings such as '2.14.0a0' or '2.14.0.dev0', because int('0a0') fails.

Switch to packaging.version.Version, which handles the full PEP 440 grammar and gives correct ordering semantics for pre-release, dev, and post-release versions.

packaging is declared as a new dependency. It is already a transitive dependency in virtually all Python environments (via pip/setuptools), so the declaration only makes existing reality explicit.

tuple(map(int, pd.__version__.partition('+')[0].split('.'))) raised
ValueError on valid pre-release version strings such as '2.14.0a0' or
'2.14.0.dev0', because int('0a0') fails.

Switch to packaging.version.Version, which handles the full PEP 440
grammar and gives correct ordering semantics for pre-release, dev, and
post-release versions.

packaging is declared as a new dependency. It is already a transitive
dependency in virtually all Python environments (via pip/setuptools),
so the declaration only makes existing reality explicit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant