A library for python version numbers and specifiers, implementing PEP 440
Project description
PEP440 in rust
A library for python version numbers and specifiers, implementing PEP 440
pip install pep440_rs
from pep440_rs import Version, VersionSpecifier
assert Version("1.1a1").any_prerelease()
assert Version("1.1.dev2").any_prerelease()
assert not Version("1.1").any_prerelease()
assert VersionSpecifier(">=1.0").contains(Version("1.1a1"))
assert not VersionSpecifier(">=1.1").contains(Version("1.1a1"))
assert Version("2.0") in VersionSpecifier("==2")
Unlike pypa/packaging, this library always matches preleases. To only match final releases, filter with .any_prelease()
beforehand.
PEP 440 has a lot of unintuitive features, including:
- An epoch that you can prefix the version which, e.g.
1!1.2.3
. Lower epoch always means lower version (1.0 <=2!0.1
) - post versions, which can be attached to both stable releases and prereleases
- dev versions, which can be attached to sbpth table releases and prereleases. When attached to a prerelease the dev version is ordered just below the normal prerelease, however when attached to a stable version, the dev version is sorted before a prereleases
- prerelease handling is a mess: "Pre-releases of any kind, including developmental releases, are implicitly excluded from all version specifiers, unless they are already present on the system, explicitly requested by the user, or if the only available version that satisfies the version specifier is a pre-release.". This means that we can't say whether a specifier matches without also looking at the environment
- prelease vs. prerelease incl. dev is fuzzy
- local versions on top of all the others, which are added with a + and have implicitly typed string and number segments
- no semver-caret (
^
), but a pseudo-semver tilde (~=
) - ordering contradicts matching: We have e.g.
1.0+local > 1.0
when sorting, but==1.0
matches1.0+local
. While the ordering of versions itself is a total order the version matching needs to catch all sorts of special cases
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pep440_rs-0.3.7.tar.gz
(28.3 kB
view hashes)
Built Distributions
Close
Hashes for pep440_rs-0.3.7-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6856e5d4a7541576b657f8c981d65a4758fe982be657e1ab721e0c35085ab161 |
|
MD5 | 1b0a27191244b69b7a0aa233a5150740 |
|
BLAKE2b-256 | de7e9a9f7dde07efdffea4c8886742fdb9a902260087d6c43fc8372584ae76df |
Close
Hashes for pep440_rs-0.3.7-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcae5b0b587ba0422edbcb0777c24df05e9533e0fb0475f1f5c1736b5698319c |
|
MD5 | 0034d19bc0d7d2913978b3de12517bdd |
|
BLAKE2b-256 | d4d86d0790fa72e7fa35a86dd7571a882bf644d1c67e17743b0036547f1e472b |
Close
Hashes for pep440_rs-0.3.7-cp37-abi3-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49ed506ed805332f0c72747a23d2b39efcc8902ef5d58c3eff61f350acdc90ca |
|
MD5 | 0e179cc93bc334777aa688a002d390ad |
|
BLAKE2b-256 | 81939f5d0d95f145f1d402ed2a8a0f6afbd5a9cdd5aa5ea11f2392acf724e6cf |
Close
Hashes for pep440_rs-0.3.7-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d30f74877c054e84d71d8016248aa03f262a142d2ba86651cb52428504b750e3 |
|
MD5 | 085cca680e4e65d7e3848fe32f1672b9 |
|
BLAKE2b-256 | e1e5dbb2a622511eaa468150608b7b5d0100b22e5fbc6e63b08dd6170dd41ed1 |
Close
Hashes for pep440_rs-0.3.7-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88f9105f99f1668cf4271e8f2b1990ead9dacebd4f8a23b34351946a59dd6077 |
|
MD5 | 11a669584773851f69a282fb580e4087 |
|
BLAKE2b-256 | 43994b0a5fef175e88a1f146615d157595093d286ec8590daa0c90bd2478f7e8 |
Close
Hashes for pep440_rs-0.3.7-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfc0730a0135ea885d9025315b8adef3b89b00abc1caab197cc6fa0d3dc61cab |
|
MD5 | 8c8094eb89b9a3ee6b57493d9c20b351 |
|
BLAKE2b-256 | 1a5e7023fecfabf1d4ccf26184113aabc1f61962108aaae8415e696e7b45584c |
Close
Hashes for pep440_rs-0.3.7-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f4f8b28db3afdcc61608dd324002aaf8be58ac20c75da83aa4461c4f0159e5b |
|
MD5 | 816d43d44ea18b16fcf6314db467c863 |
|
BLAKE2b-256 | 0328b42edc38bce0cbeff52b70d7001f4da0d8a79b4a92e923d78644d5dec62c |
Close
Hashes for pep440_rs-0.3.7-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13eed67dbbabbd2a9dc80f978d0cfe3709bd59c7d5f921fa7bd4e5dde4363ac4 |
|
MD5 | a17d22c2b4c0229f79456eabb7867278 |
|
BLAKE2b-256 | d369ee0edc113010e0d5cbc99632458e70835ca7fa0398a82aa120ddd761b382 |
Close
Hashes for pep440_rs-0.3.7-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57ceeb7838e5a1cef1c2119479e2d1bf3de35aa2a9e6c4fc83de7a2762f133ea |
|
MD5 | 220d13ff90f70add44047b625611702d |
|
BLAKE2b-256 | 02d1c513557ef771fef6e092252e92bdf9304432a5f4822495f91b7f45d48dd7 |
Close
Hashes for pep440_rs-0.3.7-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91af1992da8ab6be40bdef1002e74912ceefc2d9e108cbee4aa802766a888a6b |
|
MD5 | d33759eb50303405568d772ba0496b09 |
|
BLAKE2b-256 | f3b2a39016e36d853166a7681f2cd2fd7601e666ebbe2d6034677cb9dc0815ca |
Close
Hashes for pep440_rs-0.3.7-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6020817be15d740e3d985fa3e3f655bfcb6caa4157ca31c5668a379efddce0dd |
|
MD5 | 29141cb1956a2720b1f495e58a50f207 |
|
BLAKE2b-256 | 7eece03f99895a9f25c6935bccb0e116b37943b087881e23de2bb498b973e46f |
Close
Hashes for pep440_rs-0.3.7-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b7669cde25915b65a98dd28a5064e78c4aaa7d00fa9adfb2a7e20567417e811 |
|
MD5 | dfe6cd74080fe7b4b3a47b6448ec8f3c |
|
BLAKE2b-256 | 38dfe9a9b53bccb661c0b33675034e088cd1f63903b616a2ac83a3e91c3138ac |
Close
Hashes for pep440_rs-0.3.7-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf506ff76ce96b6d243beec6bee9f7cd6cf1b0f9251b9e5b68d1cbcb1a0afe7d |
|
MD5 | 9c5a13d7485685482e248e5f07773f4f |
|
BLAKE2b-256 | c2623fcbd7b3f44165dbe97060f4fd8c3a7fda00c1699d05b744d5f06168fc95 |