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

Uploaded Source

Built Distributions

pep440_rs-0.3.5-cp37-abi3-win_amd64.whl (482.7 kB view details)

Uploaded CPython 3.7+ Windows x86-64

pep440_rs-0.3.5-cp37-abi3-musllinux_1_2_x86_64.whl (755.7 kB view details)

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

pep440_rs-0.3.5-cp37-abi3-musllinux_1_2_i686.whl (747.5 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

pep440_rs-0.3.5-cp37-abi3-musllinux_1_2_armv7l.whl (754.9 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.3.5-cp37-abi3-musllinux_1_2_aarch64.whl (707.2 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARM64

pep440_rs-0.3.5-cp37-abi3-manylinux_2_34_x86_64.whl (583.7 kB view details)

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

pep440_rs-0.3.5-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (684.9 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

pep440_rs-0.3.5-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (718.2 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.3.5-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (756.9 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

pep440_rs-0.3.5-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (491.1 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.3.5-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (527.1 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.3.5-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.5-cp37-abi3-macosx_10_7_x86_64.whl (550.5 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pep440_rs-0.3.5.tar.gz
Algorithm Hash digest
SHA256 b0f2af8e507175cb282738e946879143502fa8221ff5e0343ff9f12d2a2b83c2
MD5 072ffb97f1bcaecaa32dcf5d39404438
BLAKE2b-256 6c37e425507e47d80d2b9b906a10ae606ba228540a9c7006610897ccb507b220

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.5-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6b1ee2b6abec55e94af98e72dbcb6a70aa7b42b9e66d8bfb93b84882c3245f8b
MD5 261fbf7fde861b0fcfa2f9ba3407e00b
BLAKE2b-256 c0e752d83822b3fcd92a819f5820b1d4d79b631c469cd8c1c2e6af4e31d8c422

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.5-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2b2e3536f87339f9936ca3c9020b79e97bb20c3471d1fb66e5ad66feef4e12c0
MD5 11eb2d7a208a2e6782de56c627c3945c
BLAKE2b-256 f67a802ed0d5d2e1505d19a91e3cab738f953a409ed8f5373459c211db237909

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.5-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 152564037eaa6014794a8b75689c4f1b5e23316dfdc168d9994293fe4bfcc478
MD5 53cd4b908ae0c6bf9bee5b541972a14a
BLAKE2b-256 7d48d27b45dcc5307aee34698dbe1b0b9513f785b5e2c17b82f0df9f853e2622

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.5-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 f6ba1ddec6118017ea25790e36552f96843c1ed2abc7329c7168ab1cb2ce9e34
MD5 f3c5bd88fd0736134912cdc1ab7b8ef3
BLAKE2b-256 9499e584049299bec0c904e35b30039e4864427ae53e8088604117940a3b0bc1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.5-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 a666b4e2b0ab8e29e0a1cd14ee5897441d477af52982ceebd006339261d86d23
MD5 4f3a063c7b78ea1501b3284a61788713
BLAKE2b-256 b58660b9bce1185a90b31d8d7fbece39a5f99766bb966bd1c82a0f6b7ba18cee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.5-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6a3ce7601609d7f60912e272fb867ec09c65e868fb3a7c7d21c75d63b69da6f3
MD5 b9cc2f5ae0183ce59a7c8d2bd11abccd
BLAKE2b-256 0f32c52ca7b4edf5fa1c6bf6a384864803af45b3fd2a898b73f331e05c8287b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.5-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 f72ce9a2b092efe9589c31af798282b89ac62193159cc80a9e42c3ab35143f1a
MD5 aecb9e21a704487cf222204e1b4b3ec1
BLAKE2b-256 3a6c075cbbc03b162e556d94815931c483ebe3b4b39dfdc608566b3393edf5f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.5-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 5668fe13e5788e515f8c2bfa524518097ff93803276ffd2d5aae1afff62bb14c
MD5 816c710845437faa5ea8f61e4fff1ec4
BLAKE2b-256 e6bdf3e9bb79fe8966bed0780b0173298fe10047f04edd4a5468a1a2f2d9f7ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.5-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 6412794a372548df77308de4c1a06ecd96191137eae8593976568793b1fcfdad
MD5 8cf3db655c72d3882cfe7960a8d36593
BLAKE2b-256 902f2882b98fa4ae2e774f1034cb841fe381e068777d56bafffa4a58ae020a97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.5-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 f24477311a0468246be27fbeb06a2f9b22d00b9cee339c0648b74757dbe8aec6
MD5 6d62838a5be5fbcd252cdc0a44a97c0a
BLAKE2b-256 c34ac863cdb88d87e2702a8e0aab8c895943991c51b5ffb386ae173167086896

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.5-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 142c002e2cd25748b9817abeb338970bf94a52e15a43de79d4cb40e235536a41
MD5 8308894b37ad35b9d6e45aea0e2bbac7
BLAKE2b-256 7203557fde9118a8df5c3f1fc22e5ea871a933b22683511784fef6c11b415961

See more details on using hashes here.

File details

Details for the file pep440_rs-0.3.5-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.5-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 19a26a6f6255d65d8ea461bc3f0bdd19116a5517f4bbead4dea3f158ca7272cf
MD5 025cc2003f43cc727bb224697e638a68
BLAKE2b-256 ec0e7982b38a6accec79ac25f9649e3fdb8e095611381335d5ad4843b365911f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.5-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 836b86e4e74e48a19365d5a37b49a0bf15681d448b34b8a666c3249da478740e
MD5 bc15ab9a3fdeac9f0c813ba3f52926f7
BLAKE2b-256 3181fc47af0642e1aef92671ad6ee650807ee0800a1a7a5bac6810198c64eb96

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