Skip to main content

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 matches 1.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


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.2.0.tar.gz (23.5 kB view details)

Uploaded Source

Built Distributions

pep440_rs-0.2.0-cp37-abi3-win_amd64.whl (475.6 kB view details)

Uploaded CPython 3.7+ Windows x86-64

pep440_rs-0.2.0-cp37-abi3-musllinux_1_2_x86_64.whl (744.0 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ x86-64

pep440_rs-0.2.0-cp37-abi3-musllinux_1_2_i686.whl (732.8 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

pep440_rs-0.2.0-cp37-abi3-musllinux_1_2_armv7l.whl (748.3 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.2.0-cp37-abi3-musllinux_1_2_aarch64.whl (700.1 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARM64

pep440_rs-0.2.0-cp37-abi3-manylinux_2_34_x86_64.whl (574.6 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.34+ x86-64

pep440_rs-0.2.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (675.1 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

pep440_rs-0.2.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (714.5 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.2.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (747.8 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

pep440_rs-0.2.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (484.9 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.2.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (516.9 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.2.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (1.0 MB view details)

Uploaded CPython 3.7+ macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

pep440_rs-0.2.0-cp37-abi3-macosx_10_7_x86_64.whl (544.8 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

Details for the file pep440_rs-0.2.0.tar.gz.

File metadata

  • Download URL: pep440_rs-0.2.0.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.14.15

File hashes

Hashes for pep440_rs-0.2.0.tar.gz
Algorithm Hash digest
SHA256 731276bf09e62b6d84d662a204f6d3d9b492f6aa82d59a65304356f8fc0f4517
MD5 fe53db7fa2c754c011444c142ba079d9
BLAKE2b-256 14ad287957ff00fc1ac6a07bbbcbe56cd0d2bf964b6b5a48271da56a388306cf

See more details on using hashes here.

File details

Details for the file pep440_rs-0.2.0-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.2.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4caec0de89d51f432669771d07b11704d561e7d68b9b3c85d83b6e64d19a0903
MD5 73a3cf07e0958dbe325763556b1c9766
BLAKE2b-256 2fecfe40818860040dca69ec50dba1b8838764f04b99f4872f2af0ced1081dcd

See more details on using hashes here.

File details

Details for the file pep440_rs-0.2.0-cp37-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.2.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7541f9a75971d5b5c65bcef548d1f9938a6a92acedbe616b0b66f2bb4a2589be
MD5 bdbdaf6f4f4df53709afc0875f830da2
BLAKE2b-256 6facbc22151c3bb33333c4436ad31bc7588d6b8c32d9cc05f328a966c9c4d7b5

See more details on using hashes here.

File details

Details for the file pep440_rs-0.2.0-cp37-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for pep440_rs-0.2.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 29ac230685e85777d8d96d9ed728e55e80ce7ae2b3fbf2468842786da1828f28
MD5 8900d8ff714d43e5bed09519ec3dd0bf
BLAKE2b-256 f049a15e01eb8bb960a5997f589b06c2d355203637145de6fa6961da4d10002e

See more details on using hashes here.

File details

Details for the file pep440_rs-0.2.0-cp37-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for pep440_rs-0.2.0-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 2f79035b7dd356e18129a52cdc1bc4418078ea89ec825ecd243577bf3029d8c5
MD5 89fe9299a03b61ed87e169628e6d7a51
BLAKE2b-256 dcd6f73cab58fcb617e51b6b30a09edc1ff1301e1502d7f99fdcac861571ec1b

See more details on using hashes here.

File details

Details for the file pep440_rs-0.2.0-cp37-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.2.0-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 17354172d788d44a04ff5f63019ac2bfb549247e0e7d1550ae357a7f1bf7b9a9
MD5 f98869f7244e7143200312fdc898e6c6
BLAKE2b-256 48ed563f4400e5103b5a27e3ce37764bffd1118161dcf65c6a1284cda9fa96a4

See more details on using hashes here.

File details

Details for the file pep440_rs-0.2.0-cp37-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.2.0-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6eefd6d56af6ff4adc6ddbc6a3885fe9963c7d3196897d307474dfe015c107f9
MD5 d4a41b51fbc4a2c76f82e8de1fd08e26
BLAKE2b-256 706e32edbc6c4838a5ea8e8195d682c4f14df7f45e65ad376353313c9b5b4c7c

See more details on using hashes here.

File details

Details for the file pep440_rs-0.2.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for pep440_rs-0.2.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 85d2d44996e0b07dfcaabf3cd33e54e87904d914fff69e2d0c4e1cd97ab40bee
MD5 250ae318e9166138f997647754a9f984
BLAKE2b-256 895eba5dc1f6cc965599883d162fdf4c1f72e555d27cb79add9e63b1c690cff7

See more details on using hashes here.

File details

Details for the file pep440_rs-0.2.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for pep440_rs-0.2.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 fd8d130a5f05f0928559bfbd265b457be94195e4eab29187d4f149604e3bc274
MD5 c679adf9a4a254bef18032a3bfcdb233
BLAKE2b-256 db6d5417c913860afd4f50786fbe2d46d172da1f2d0657f8514115511ea7bc1c

See more details on using hashes here.

File details

Details for the file pep440_rs-0.2.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.2.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 9ebf94ff66e2517484db746ef8b619a7a504ec4cb95d00091b9cc2277f95121d
MD5 3a6c3404040421058b5f3e41d1b30cb9
BLAKE2b-256 20bebac91db55741bff7750c809265f81c41e832d0dd261c568cc1e6195afe19

See more details on using hashes here.

File details

Details for the file pep440_rs-0.2.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for pep440_rs-0.2.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 7a84ec74a7f5ae1d5e2054f48c0d1f3af0b99019c531b90b42150afa1d24ca49
MD5 2bb7e6a2820cc7acdae7783f93517218
BLAKE2b-256 f858f88bc12472fa8ca1b9c3b9450e5f6951ed898180c5f56423a0b87edc1e38

See more details on using hashes here.

File details

Details for the file pep440_rs-0.2.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.2.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 41a3f92483f98607c2f13a336682608afbcea7b85f33124d78e72d05bb2d58b2
MD5 6c2c43c9df066f7e04eb7db454fad76c
BLAKE2b-256 ca7dd14d5c2d41b9c0ba482139eb3cc5244a71bf542f1c3a0eeb869d034c9801

See more details on using hashes here.

File details

Details for the file pep440_rs-0.2.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for pep440_rs-0.2.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d8decc21c8757aeb29342a5821ba1f4f433f204994d383e733aaab9d14c3962e
MD5 f8f123a66b7fc9292181b66fcb433d78
BLAKE2b-256 f3788c5f82727c17e08e68c8c137c315abfd680c2947f5e4a3f73f7886803d8a

See more details on using hashes here.

File details

Details for the file pep440_rs-0.2.0-cp37-abi3-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.2.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 fd578e4cf9872fbf90e9b0f6976ee14665602a5c9affef141402dd90f8390696
MD5 1cecc41e942346118f94fc46cf87d16d
BLAKE2b-256 19bece9708d0493baa22b19e245b44273e44e6e492012f87499f5e444d0e7db9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page