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

Uploaded Source

Built Distributions

pep440_rs-0.3.4-cp37-abi3-win_amd64.whl (483.5 kB view details)

Uploaded CPython 3.7+ Windows x86-64

pep440_rs-0.3.4-cp37-abi3-musllinux_1_2_x86_64.whl (757.4 kB view details)

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

pep440_rs-0.3.4-cp37-abi3-musllinux_1_2_i686.whl (749.0 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

pep440_rs-0.3.4-cp37-abi3-musllinux_1_2_armv7l.whl (756.3 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.3.4-cp37-abi3-musllinux_1_2_aarch64.whl (706.7 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARM64

pep440_rs-0.3.4-cp37-abi3-manylinux_2_34_x86_64.whl (585.6 kB view details)

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

pep440_rs-0.3.4-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (689.2 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

pep440_rs-0.3.4-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (711.4 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.3.4-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (750.7 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

pep440_rs-0.3.4-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (492.6 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.3.4-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (526.5 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.3.4-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.3.4-cp37-abi3-macosx_10_7_x86_64.whl (551.0 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pep440_rs-0.3.4.tar.gz
Algorithm Hash digest
SHA256 c02b28af9403e39da7d3c9717f8329cbe333db432e708aba57f64b6f44b7972b
MD5 368b41b3463c56147f626042c53819fe
BLAKE2b-256 23e7249274c21e124df0c91aa0e7458bfb0f41038c010f5ad99594de74b7a7bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.4-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 02b18629ea5514df5f288b74a5d36e698ff2be49309449ab6d9d7a4147a4690c
MD5 809470e45c81b8d0a24bf9627d044773
BLAKE2b-256 fc45a3c97d028193c9f1ff8676f978501ec80ed98b3c53ade3a0a0d9b48369ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.4-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 d79038dcaa027524c0ef92930c01f06ca1c7342ac383b1748c94113f60b57372
MD5 8b5913db3277eafa7b73e278cc891b81
BLAKE2b-256 ae9775b388ce46f7d0b6c6ab3271d073bf6434b4872fd9f238a861aa9fae009a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.4-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 8a5c5b398d26eaecd92af64d0b91ad48f77142b5deb2f0bdfdcbe4b6f0e74b25
MD5 a48c89d93693c6964b86f5d6ee6c1f0f
BLAKE2b-256 6614811d5d95148be7764f7a942065cc052cd45191a68fb0dbc8b072fc86944e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.4-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 d16b2d37275a4376ea71500314c923f18223919f0c73d24fe31d5405df3df851
MD5 6b7fb5dcf33076a22ff1e7247428e6e9
BLAKE2b-256 27e6ef762c590e8ae1bb875d99ad065393ad65a93d005e441f07bb1b1efc920a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.4-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 4ef5816b3d848c2e3d332214aec3af21aee76064a4378bd60d79a7a613d012c3
MD5 a13c730e7f0a746c7c8bd3d191fb624e
BLAKE2b-256 233dc174e3a978372d990f6dd7035a4972c23602a8da7c6a5e9c1b93c7558b2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.4-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b42e494694d15b504a9c6692cad62218fa2d41fcd6854efb6e8594679661e853
MD5 7c10cd21172cfcd1ab05c4aae7d6c857
BLAKE2b-256 87750d57aba1bc01a8fbcf7ff420d3bb4949bafb5c613763e2e1cabaf0e9d7a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.4-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 c22cac852fc2232aa547f6807c258f78b76bfda506c3c90c81b2b1b2fbd92d1b
MD5 62172a7f38f1fd4b05f758c219c4e5f4
BLAKE2b-256 d65a802f579b0f5bff0b44caf13c5068a2fec9f8510718d71e48c5cfbd90b7d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.4-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 550c06f2efd3f8c14fa335376d037416c5300b9ddfa1d3d8932e073cf3fc274b
MD5 957689235082f54a83275c60bb11690a
BLAKE2b-256 3134d407967505e0b924aa43b1ea159b9cea6521d5e55f4eecfc4ac70cf9e4f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.4-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 2ca9565315b4306161d119f1418e0241139254447ed5b653c0895b55906bc2ec
MD5 d5b80cf22ffb22877a17727ef7d127de
BLAKE2b-256 16cc0c5023b94ad5113b196608b96fede8a3ed7a69bd9162059d1e9c8f827614

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.4-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 49db81b7f9c3cb54191924209c4fd69ee2e784b0bd5c6e418a694a67fa8e6c40
MD5 5bc9273844a1cb818f9733df88b5a188
BLAKE2b-256 9ef9c3c5c8948a825e3d0045e0c2fc604fd3de182385125f51dc375b7ca323ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.4-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b882fa6682cc4e9ee4addc7e3e4aa3d5ba9571b74c2b11f7d2e548cfabcdbadc
MD5 98722768496a29cd93b4eff269f2525f
BLAKE2b-256 fc184a86c8e1387ea83f35e757a8a359b495e05cef0b006664053d76c348e45a

See more details on using hashes here.

File details

Details for the file pep440_rs-0.3.4-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.4-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 caed01546288a07d42aa644d006b34009b16c10f3f51c2e7c0aa9bee9c1fa05e
MD5 425ebd1f5cc9981f89cb6951257c5fb3
BLAKE2b-256 965e98a313cc699a261c79362efe6635e60389356088cce397b9034612d8d87d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.4-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 a1adb3fc5bc6e6f5eeb5873b9488da93b2fd3da36c90d8df2495b376f3038706
MD5 e4ed3dc11e803c325a3c3b05404e3e83
BLAKE2b-256 1ccb0f3cfb7c79d8ea97dd73dfb2d564bb538055c7e884d4b876d57ccf893343

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