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.12.tar.gz
(28.5 kB
view hashes)
Built Distributions
Close
Hashes for pep440_rs-0.3.12-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a03595c09bf58b83e575054400d84942dfc6d5a0953334b6e17f918cfae6cbb |
|
MD5 | daae7cb2ad858e4c65c07f72f94bde97 |
|
BLAKE2b-256 | c41953b09169c6fabdd7e0d830a34c8ff9a3c51fc10980cae50ae06e30a42453 |
Close
Hashes for pep440_rs-0.3.12-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c49267bc053c742d9bbe39e3edf7395c84de43ba460a09b7e2dbad224855c4a |
|
MD5 | 83cd5c374856931a2dc74c67c7abcb59 |
|
BLAKE2b-256 | ec1e5310aaa245d08011c3b36ea5800dd7e5f2e5ea65d5259f3995c05d0345fe |
Close
Hashes for pep440_rs-0.3.12-cp37-abi3-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f3bec499f2dc9090ffc291e1f1597a01c53a82a03f871c8944371542bc0f3c9 |
|
MD5 | c7f4dbcde5a79103c4f8882e505fc323 |
|
BLAKE2b-256 | 93e544f0402a715e2e68aac30b87b48fc2fe9db7c299f86e43b41bb967f46fe2 |
Close
Hashes for pep440_rs-0.3.12-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6eb76ca0dceceb9b65913ef317bbfe08526e3d32375239bd969f7cd72a1cd3ca |
|
MD5 | f667f5d1622c0c3cb7d2d3e5e4e294a5 |
|
BLAKE2b-256 | d06ac34069e8aae1d8a302bb46b4b96c09d828bb616dcd11b5ef5e0440fc9389 |
Close
Hashes for pep440_rs-0.3.12-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d2cf7c7dd7fa8799f4026cf800dc0fb6e038524e2d3b3f84f0d2a6c035e0afb |
|
MD5 | 882c725c2c6a71fe448d6d7cf9b197dd |
|
BLAKE2b-256 | 8177c517f38438e7734d71e9bf481a08db633dc6e7966337bd5afc6899f536f0 |
Close
Hashes for pep440_rs-0.3.12-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ab7b368d3c1d370fa884839f7882d66e87db7ca89a95b133519dcbdd6e3831e |
|
MD5 | 050e7b20b084b6fe0d7ddd902c37c1ef |
|
BLAKE2b-256 | 647f8ba5312832ad3aa46c2b3675b1bc4c0d9c083e5bd25e3a95fc3059b5f30f |
Close
Hashes for pep440_rs-0.3.12-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b58814ebd48a3b8488b032c73d7197f2fc488239043826292a81614298a46f2c |
|
MD5 | 4e0df0df0d77b348516a969ae6310f52 |
|
BLAKE2b-256 | e7e620391230f4b3aabf68234c5ed38720fe30cc31f4ef1c05d7a26ea4d6be63 |
Close
Hashes for pep440_rs-0.3.12-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44ef4d6279c2c869e234568f2e17b7c105c422a0344ab8f9d71c580e2a60e3c6 |
|
MD5 | a7f61d42d4207f13c539671d0bea9c13 |
|
BLAKE2b-256 | f277e5f63470e70e7d117c26f47b60cd4d882478261dd596457ce00233487c02 |
Close
Hashes for pep440_rs-0.3.12-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62a9fc536ff344982268e50c68d7490efff09bdb80381803fada3e92de4de43b |
|
MD5 | 45ac8e209a1b01d83fc5f3d59cebb4ef |
|
BLAKE2b-256 | f6d6e6116c8a60952b39241da9f9d66e1ad9ea0ab64a55550a31f55d3840a05c |
Close
Hashes for pep440_rs-0.3.12-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fc298674867422c7afdd01a7ba2c9c19dcbd59b9dd6bfaedffd530b53552fe1 |
|
MD5 | 8d21db6f09abc8ca2576bd5eac4fdfd3 |
|
BLAKE2b-256 | 14a9c0a5adf6b7461eb7d6a531f5fb3dad4640d160e234a486a1d284fa64ff3c |
Close
Hashes for pep440_rs-0.3.12-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3798e416f56c87c77ca37910155caa05a71134182f05dfbc23ca4e8fa078223f |
|
MD5 | 73a9f83362c5230ce34e571fcc8e7980 |
|
BLAKE2b-256 | 66cd7707c4560eb99424eb0359b19a056b63bb685c25bb40cdc3d2c960720ae1 |
Close
Hashes for pep440_rs-0.3.12-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 655caed62c15deb8b0a7e16b8229c458c349b5c03688a27360bd8c34e1cdc4c7 |
|
MD5 | 04210820a119862874f300353d939256 |
|
BLAKE2b-256 | f621932cb2be6ce8f69adea1256ffbe9531b981631e03090e73694c822784366 |
Close
Hashes for pep440_rs-0.3.12-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4a72712a7fc04e1599cefe68b068136a879b4d7126a29ec74e92c56d40b9df4 |
|
MD5 | 355ba61560da7a879fd8784ff7c880e9 |
|
BLAKE2b-256 | acae7f0cf2655015b6608e849a8908cc3dced02c49cface0588f56200ae7bb95 |