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

Uploaded Source

Built Distributions

pep440_rs-0.3.12-cp37-abi3-win_amd64.whl (675.6 kB view details)

Uploaded CPython 3.7+ Windows x86-64

pep440_rs-0.3.12-cp37-abi3-musllinux_1_2_x86_64.whl (956.5 kB view details)

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

pep440_rs-0.3.12-cp37-abi3-musllinux_1_2_i686.whl (940.5 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

pep440_rs-0.3.12-cp37-abi3-musllinux_1_2_armv7l.whl (959.1 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.3.12-cp37-abi3-musllinux_1_2_aarch64.whl (918.1 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARM64

pep440_rs-0.3.12-cp37-abi3-manylinux_2_34_x86_64.whl (818.1 kB view details)

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

pep440_rs-0.3.12-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (901.7 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

pep440_rs-0.3.12-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (920.3 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.3.12-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (950.3 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

pep440_rs-0.3.12-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (695.6 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.3.12-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (739.5 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.3.12-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (1.4 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.3.12-cp37-abi3-macosx_10_7_x86_64.whl (756.9 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pep440_rs-0.3.12.tar.gz
Algorithm Hash digest
SHA256 e206d007510d427616518dd21ea5c9c2779c5bbf40a3cc0ce9bc2905a84320f2
MD5 ae3695d1172ca1717952e909f0144159
BLAKE2b-256 2c5dd1c228af7a2e3bec5a5fff1e1370d47b51518cbd216bd2884885245500aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.12-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0a03595c09bf58b83e575054400d84942dfc6d5a0953334b6e17f918cfae6cbb
MD5 daae7cb2ad858e4c65c07f72f94bde97
BLAKE2b-256 c41953b09169c6fabdd7e0d830a34c8ff9a3c51fc10980cae50ae06e30a42453

See more details on using hashes here.

File details

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

File metadata

File hashes

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

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.12-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 1f3bec499f2dc9090ffc291e1f1597a01c53a82a03f871c8944371542bc0f3c9
MD5 c7f4dbcde5a79103c4f8882e505fc323
BLAKE2b-256 93e544f0402a715e2e68aac30b87b48fc2fe9db7c299f86e43b41bb967f46fe2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.12-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 6eb76ca0dceceb9b65913ef317bbfe08526e3d32375239bd969f7cd72a1cd3ca
MD5 f667f5d1622c0c3cb7d2d3e5e4e294a5
BLAKE2b-256 d06ac34069e8aae1d8a302bb46b4b96c09d828bb616dcd11b5ef5e0440fc9389

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.12-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 8d2cf7c7dd7fa8799f4026cf800dc0fb6e038524e2d3b3f84f0d2a6c035e0afb
MD5 882c725c2c6a71fe448d6d7cf9b197dd
BLAKE2b-256 8177c517f38438e7734d71e9bf481a08db633dc6e7966337bd5afc6899f536f0

See more details on using hashes here.

File details

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

File metadata

File hashes

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

See more details on using hashes here.

File details

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

File metadata

File hashes

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

See more details on using hashes here.

File details

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

File metadata

File hashes

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

See more details on using hashes here.

File details

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

File metadata

File hashes

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

See more details on using hashes here.

File details

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

File metadata

File hashes

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

See more details on using hashes here.

File details

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

File metadata

File hashes

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

See more details on using hashes here.

File details

Details for the file pep440_rs-0.3.12-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.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

See more details on using hashes here.

File details

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

File metadata

File hashes

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

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