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

Uploaded Source

Built Distributions

pep440_rs-0.6.5-cp38-abi3-win_amd64.whl (173.0 kB view details)

Uploaded CPython 3.8+ Windows x86-64

pep440_rs-0.6.5-cp38-abi3-win32.whl (165.2 kB view details)

Uploaded CPython 3.8+ Windows x86

pep440_rs-0.6.5-cp38-abi3-musllinux_1_2_x86_64.whl (476.0 kB view details)

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

pep440_rs-0.6.5-cp38-abi3-musllinux_1_2_i686.whl (500.0 kB view details)

Uploaded CPython 3.8+ musllinux: musl 1.2+ i686

pep440_rs-0.6.5-cp38-abi3-musllinux_1_2_armv7l.whl (578.7 kB view details)

Uploaded CPython 3.8+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.6.5-cp38-abi3-musllinux_1_2_aarch64.whl (493.3 kB view details)

Uploaded CPython 3.8+ musllinux: musl 1.2+ ARM64

pep440_rs-0.6.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (305.6 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

pep440_rs-0.6.5-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (357.8 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ s390x

pep440_rs-0.6.5-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (343.4 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.6.5-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (316.4 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.6.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (315.4 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.6.5-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl (323.7 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.5+ i686

pep440_rs-0.6.5-cp38-abi3-macosx_11_0_arm64.whl (264.8 kB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

pep440_rs-0.6.5-cp38-abi3-macosx_10_12_x86_64.whl (272.5 kB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: pep440_rs-0.6.5.tar.gz
  • Upload date:
  • Size: 47.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.7.0

File hashes

Hashes for pep440_rs-0.6.5.tar.gz
Algorithm Hash digest
SHA256 97347b4423bdd903a30c6ac0ef9755bc2744f39ae10ffdf50844ef79089c4e02
MD5 1be2a7558048660b1e7bd2d433eacc05
BLAKE2b-256 305ced6066ca8ae413e1f751bf7e61a08ec11642514d7d115b376ece6962d16d

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.5-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.5-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0814a66b7a67b50011f58dd425ce15d9f926e5c60eed9ca9b6465b5a8da73cd0
MD5 4a0cab855542463bd857cd3793160529
BLAKE2b-256 7198ed56b7fd2e1cb340ae8e0a76ef14bcfd57db5232a0cec695dfa27be9368b

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.5-cp38-abi3-win32.whl.

File metadata

  • Download URL: pep440_rs-0.6.5-cp38-abi3-win32.whl
  • Upload date:
  • Size: 165.2 kB
  • Tags: CPython 3.8+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.7.0

File hashes

Hashes for pep440_rs-0.6.5-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 89b6557881cf80757982fd5fe7d4d366e27e6d51afcaf8a5087f918f7fdc0b64
MD5 184905387a7d0e8f33d4b89fe0b7020a
BLAKE2b-256 e75511255204893affd4201b589ff03be7e0789eb9b5667151c855831cfd40ec

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.5-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.5-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0de9686e1cf356c7abd4a29148e6254b3bcbc58ec6388e57e9f9a8501c85cb6d
MD5 70403ee243613787a070ff68ba38e643
BLAKE2b-256 c51139a875e7adb7015d07ce6ea1257a16b83e114ced8d19d7f914c6c20c2d0b

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.5-cp38-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.5-cp38-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 65cba7c0350f7443b6d8eb9b4a0612d35b64f0149448d9294c8d02819ebc2667
MD5 111454686fc5da6173136fd88cd3bedc
BLAKE2b-256 c3febb8e454e0dd777f92bbc2b4bea1af12e831af10280f1b9fadd46cd3c01b4

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.5-cp38-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.5-cp38-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 78a15ff8408c30ee3e501e97fe9e8a9f5c87e4e0f07a5e1cba997530bf6ecb1e
MD5 548e07f69339c14c99e04cd33a72bf35
BLAKE2b-256 d137c623ce1ea2e8f60d0b865158fb6990bbadbe6c1acbfbf22e0a449066745e

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.5-cp38-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.5-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 2ac95c12aeeb3bf3fc7cc40cacae6f57a33b42097d65a3c1ad81b189271d0485
MD5 8a3760415342670dbe27c15c484a184d
BLAKE2b-256 170c3feb949e45ea012f8e8dcdeeb038181041b4b6e2fd13f0a0ac12f762899a

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ad8a63034c1e4d3a64107b9681df40cd692eb5d71ba9f12c70ca2d7b24225021
MD5 fb762b314614bfa0835b08296b9f838b
BLAKE2b-256 90bad7a1f9f39229415d0e9a9cc75fb125339ef1e882b0fc56e2d0a3c7140622

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.5-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.5-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 f5fdb68ee25f9c42c6a812f3f67cb3df4a2e34e2a08d7984de2e6ecd6ad6a6f6
MD5 63af57a21a69292bd0ef4745cd8a6c8b
BLAKE2b-256 2291a019f49e607b1b4cf637a9892d304510dac295a1b97c7274e99f36864d74

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.5-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.5-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 a0498ad4fbcfe74ac8cc3e55fc2b3f0e22fcafa9b203030d162693726305f1d1
MD5 b52670a7d72601057cc95bac4accbae8
BLAKE2b-256 f1f6712018c85fa795765dff57860a157e2f961637fa04c26e70888fcca2fef2

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.5-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.5-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 b9c35e06dd90f76ac510c3e55f5f20226ebffd60bc317c13ef7074bc2fe52511
MD5 bce2e471ff3c108a1f467502bb481dbc
BLAKE2b-256 b4fe0afabff9dd72a4c9fbc01d54baf52f8c56c86a546bab843908a77592c7e4

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 35aa07b312f781937d6606a8f74428679c35953946b0061d618eb2b9c348942a
MD5 45874ca7d7509f8aab74298fd7791099
BLAKE2b-256 4ddb06f606d6ecb0977b36d30b76a885b48604f36405b4092688ede42afb71cc

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.5-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.5-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 9aff97fd300aa500bd279e17430252a98fca5d2e9208edec5107e9e120091cf3
MD5 30527ff074d29b0d96898864f99765ae
BLAKE2b-256 6cda5013b5a6e9cc24daf643f6ee678fd152b0468778eb5bc3f0a1c541ad53a1

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.5-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.5-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aa9bacde12f3e21582c7f072cba587eb3666babb51dcb35af5390a6734759231
MD5 bb172740cafdf642f22b881ad645b9c2
BLAKE2b-256 a1165cc32b4fbf247a77af1a9a28bba38b4c52f2ddcdd7880488acd1ac246a2a

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.5-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.5-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bb78fa69cbfb565fe78c974cda89b4b205fbc6e682bf9fee8b0fea96cb51d0f8
MD5 a6d03ebb236faddd1155653979d1a210
BLAKE2b-256 e85f931fc3a873603abfe89ff6feed919b168218d215e4a59f4ce0d7ff0f08c3

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