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

Uploaded Source

Built Distributions

pep440_rs-0.5.0-cp37-abi3-win_amd64.whl (174.9 kB view details)

Uploaded CPython 3.7+ Windows x86-64

pep440_rs-0.5.0-cp37-abi3-musllinux_1_2_x86_64.whl (442.8 kB view details)

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

pep440_rs-0.5.0-cp37-abi3-musllinux_1_2_i686.whl (466.1 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

pep440_rs-0.5.0-cp37-abi3-musllinux_1_2_armv7l.whl (527.8 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.5.0-cp37-abi3-musllinux_1_2_aarch64.whl (436.8 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARM64

pep440_rs-0.5.0-cp37-abi3-manylinux_2_34_x86_64.whl (271.3 kB view details)

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

pep440_rs-0.5.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (350.6 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

pep440_rs-0.5.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (306.1 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.5.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (318.2 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

pep440_rs-0.5.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (264.0 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.5.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (257.4 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.5.0-cp37-abi3-macosx_10_12_x86_64.whl (244.6 kB view details)

Uploaded CPython 3.7+ macOS 10.12+ x86-64

pep440_rs-0.5.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (478.6 kB view details)

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

File details

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

File metadata

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

File hashes

Hashes for pep440_rs-0.5.0.tar.gz
Algorithm Hash digest
SHA256 86662b355aef9c0318187d7ac3aa9ca1de34c6cfd51382898ab1c22797193018
MD5 e92ea305c7a9e71e0f6655b976ec1f0a
BLAKE2b-256 da73e233a23d0e5275f780117fae2d4e2ae04738dd141031f2daefe539744af1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.5.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e66e2a343aecf2cea88ad77fb80cc44b897eec72d2a4f7cd43ac96e8b9205a8f
MD5 5f4cd2c22c9f79467698e110810d75de
BLAKE2b-256 02e867e6890d700a8ad42cbf09b3e50f51d35bcb2a16da3a09fa0c7e2eabb484

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.5.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b6523961f33a396b546c4ec4f2201d1eb4c410a5c92ea23d1218d34860081d07
MD5 1eba338e957c802ee7e390d77ce156e9
BLAKE2b-256 c2b0b94d305a5383e892c6e4f3890b78983114e14c5e15b1ae1ce1a5741598f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.5.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 473227f90b8d23cf93d391a831afdc38770491564aa5c97b1915943eae95a46e
MD5 6e95918ac715b5cf6295ef6f10e3a68f
BLAKE2b-256 9d84e44b68a9c7fc094a23aae00a0b04bff2705a1808fd649e105182504da38f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.5.0-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 2e8413629f91d949b85f798ddb87349904e1eb3ca9f17a2f70c343bc57515104
MD5 9300accef627652a3af47cc21d323466
BLAKE2b-256 37c801d218959a79deb772b4aecfd2741cb5018eb74dc873fff3ba39595dc408

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.5.0-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 bba855fc88ce82f5d6651d3da10e318be7cf20c764f261f7c789dfd5efbf39ec
MD5 7fc55e21bae5669d1e97f69600ab328f
BLAKE2b-256 49a917b830d0e0978ddf19c18e498704f55b64a22f12d836d7f9b6b4fea8ed46

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.5.0-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 598d7bd08f1ca073fe77cb0001124ef1996e8ebee5f221a5b20fd5d0951087ed
MD5 b3e9ff6dfbd12b8b27f10f3f139e5c68
BLAKE2b-256 d17aac4fabd45344331bfcbb1f07c2f50b2626d320fcbd8f6fe675a584c8da99

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.5.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 5f304a0c949a9220640858d879e976c3931dfa3f852dc386508d7351786378c8
MD5 546e19ce4f161e4879f03eae06839cdd
BLAKE2b-256 b8b040e62978f13a9c86372b9d04bee53cb99dac93a1fcbfd818ab94b268e357

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.5.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 a32a08bf8f68e03c711efd2eb87600523efe4a372daef460355eebfa0f9bd40a
MD5 c0099816dc13f8c3da62dcbe68f843d3
BLAKE2b-256 76d7172f7d1f214a50ea2a5b3a9d44c70854057c669e413c724401ed1320481f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.5.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 282447428f761d9e901829f2821bf8f61232e53ce9ff4a4f1c924d10434f6fe9
MD5 f7aa74f921ff41723ca5818a85581520
BLAKE2b-256 b5fde00c07869d6eab440445de1567738522a6bf824ffe7f7cc3babc1767ca39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.5.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 213816fa1f8574bcfa10cf8d84f94f21f02ea6cd5d72dafad1c83b52d26627a5
MD5 40169fddfb53ae888bdff0a87ffdcbfc
BLAKE2b-256 3a05839fe0aa1f851f160b71aa589af4107490684235a27dc52b78ea868d31e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.5.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 92201cd3ccfaa21e45940dc3448f5f4dab8a059518c15e5f7d8df83f4c17e1cd
MD5 740c395559ef23cdfa41e2c935cb46ff
BLAKE2b-256 d992f3cd3b3aaf777ba88ffb6afccffca88958564d84e84c1cc5afe57bdf5289

See more details on using hashes here.

File details

Details for the file pep440_rs-0.5.0-cp37-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.5.0-cp37-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 eeee9a3e246d41c3fc4e6e32ce8af4d2b19387684347d8431fda20c319a664b1
MD5 3066f7e43b724fbd97632c662e31e216
BLAKE2b-256 8b61c19f5af53983b6a3111620dae6ff2de561523e31691358ee046a35f9f298

See more details on using hashes here.

File details

Details for the file pep440_rs-0.5.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for pep440_rs-0.5.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 ef47d7ca86e262210648dbda86f1389cceb9a31474d26690e95ca14db6241b48
MD5 fc997fdb032b1ddd09d5e70badba8c2e
BLAKE2b-256 adb9373decfb4301ebea695ab8a1b68b823f92243074de9441870cb15e5c9d5c

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