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

Uploaded Source

Built Distributions

pep440_rs-0.3.0-cp37-abi3-win_amd64.whl (469.4 kB view details)

Uploaded CPython 3.7+ Windows x86-64

pep440_rs-0.3.0-cp37-abi3-musllinux_1_2_x86_64.whl (742.4 kB view details)

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

pep440_rs-0.3.0-cp37-abi3-musllinux_1_2_i686.whl (732.1 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

pep440_rs-0.3.0-cp37-abi3-musllinux_1_2_armv7l.whl (743.9 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.3.0-cp37-abi3-musllinux_1_2_aarch64.whl (694.5 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARM64

pep440_rs-0.3.0-cp37-abi3-manylinux_2_34_x86_64.whl (570.6 kB view details)

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

pep440_rs-0.3.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (669.2 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

pep440_rs-0.3.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (696.6 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.3.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (732.9 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

pep440_rs-0.3.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (479.8 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.3.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (513.1 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.3.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.3.0-cp37-abi3-macosx_10_7_x86_64.whl (537.1 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pep440_rs-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ad7bd94c1cc29d855210e292818d79e79d2f3b58a20d25063071c30d11cce125
MD5 499aeb2547404df462ebfc7785d09a45
BLAKE2b-256 a1ce045b84ce692fc230b60f8d0e6373fae8a1057db44befba204433b50a6c8d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3eaf76094e468e08554f5782a26f30b8a39c6c2e4e4e0625a5b9b1895bea3149
MD5 de0e8ce6bf849b1dbba8ab4c61855a86
BLAKE2b-256 8f67654990486bf29e589bf0d4a1ae3c42444b6c1140516b2b19003ec464156e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 fbd914c8dbef0953e409f0e3a653c8dd3fc21ea4833374b54cd8f49440402e73
MD5 3ebb4e79e40d08ef9c6358abc291ee90
BLAKE2b-256 439111fcd8fc40a9f844bf3ce3d354361fc279660ba48d63e14344d7ed6cf12e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 c45d064dc83eb8ab1c0757fbf2a59364422fd0cba2c8f4025e64cc129db181f7
MD5 e915444746084b480e52cf15e14b20e0
BLAKE2b-256 0899bc0e7638ff5876bd28f5d4db17916de76daf047488023b7a4ae24f09298c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.0-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 11bb60fcf9b070fa6f39bbb88b3be8cce5106b00f63f6ba3349f8834b2412442
MD5 1f67ff05ea20797d20e5a4165eb5d2e3
BLAKE2b-256 422e00263f625956c943d7f5e63d92f272e7006c8fdaf8edbe0d623de4269584

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.0-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e82749c8fc5cb06c84c56c33d3b0d1428256d50eefa15899c6147d114654957a
MD5 d64ec9dc7d9d3bbe200e8f98077bf14b
BLAKE2b-256 6983cd6a8ee0879c249bba04b990209920c3f7ddbdef7586324dfd7e5c65bda0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.0-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 97cced7f610fea91dd689ab79e05114b661a4936b56a6fd8192d2194f87d895e
MD5 52fa4b3a1e0e7affa06e1dd18696cb73
BLAKE2b-256 80b72f0591abebc99ea0250a94fffd0e5b667f558dba47ff0bd539ad0e47a1d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 1424b6d0f5c911421dec405c488ee606ed1c775c8a2155d4afd67ec6d0c04e0d
MD5 0d95fcdab55b3f2d0cb46aa80c9cbeb3
BLAKE2b-256 74e3f241255b148dbf041dea2b5103233efc7da17d1c3b861ab3f682a689e65a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 c496e2548c2d8816d9d92de65f08de612f9bfa8855ca4308447743c3b8b73af0
MD5 90d6d3af6b23f339a1e7d45785c7208d
BLAKE2b-256 0c88f4c37986c32c86ec403933f5e0096f28e6b86018e6c9d19b06e2c59963d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 3f3d7c9cd59eebcb4a9802fd1c98103f6f7773aea2bfa1c44720a971ab9b7163
MD5 5524d70f364f3e7d33fcb5410fb8bbc1
BLAKE2b-256 49f77df0298a599544b0a65550943924caaddb2afd467b4212f7e34f34dd9ee1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 bda809bcae0cfa909f7a599eac5153461aa13e12f5268db68aa61d4f5976e8f6
MD5 ec87ca0e19c6f52fd987228fb1c8d0ae
BLAKE2b-256 4dd0e61c197c3958156cd2a084ee79b941447ac11cfeddc4e12f38e249caada9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 01bc99d67aad19f56c2bfee184c1a15c85291c04be5eae0c49b7979b44eec83d
MD5 8292cbb42ea87441c5993c6dbdac5c0b
BLAKE2b-256 0145b185ed176e0c3634c500de3664dd679655c4729cd729d1ec1a962ade1f98

See more details on using hashes here.

File details

Details for the file pep440_rs-0.3.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.3.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7b583e80e200c0891465b85d6b038b303f459699e244672b15b345a1e9869958
MD5 0d23d703c51d459f3049b5f9ea60dace
BLAKE2b-256 29f5407e294b9e7b79e222e61bb180459f24cae8ac56e735bb1b0f6dd5148bed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 a6f201f9e0fbba9e1c61a50a869437b03c4fe41a814eb11d679f8f8029559337
MD5 6af36aa54a09d780d3a14bf1482b85d9
BLAKE2b-256 b48b0e853b17b21d4b69864a9be97397671c4e2be82bc317e941978fb8b36250

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