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

Uploaded Source

Built Distributions

pep440_rs-0.6.4-cp38-abi3-win_amd64.whl (173.0 kB view details)

Uploaded CPython 3.8+ Windows x86-64

pep440_rs-0.6.4-cp38-abi3-win32.whl (165.2 kB view details)

Uploaded CPython 3.8+ Windows x86

pep440_rs-0.6.4-cp38-abi3-musllinux_1_2_x86_64.whl (475.9 kB view details)

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

pep440_rs-0.6.4-cp38-abi3-musllinux_1_2_i686.whl (500.0 kB view details)

Uploaded CPython 3.8+ musllinux: musl 1.2+ i686

pep440_rs-0.6.4-cp38-abi3-musllinux_1_2_armv7l.whl (578.6 kB view details)

Uploaded CPython 3.8+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.6.4-cp38-abi3-musllinux_1_2_aarch64.whl (493.3 kB view details)

Uploaded CPython 3.8+ musllinux: musl 1.2+ ARM64

pep440_rs-0.6.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (305.6 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

pep440_rs-0.6.4-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (357.8 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ s390x

pep440_rs-0.6.4-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (343.5 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.6.4-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (316.3 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.6.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (315.3 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.6.4-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl (323.7 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.5+ i686

pep440_rs-0.6.4-cp38-abi3-macosx_11_0_arm64.whl (267.2 kB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

pep440_rs-0.6.4-cp38-abi3-macosx_10_12_x86_64.whl (272.5 kB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pep440_rs-0.6.4.tar.gz
Algorithm Hash digest
SHA256 704528ea938b61c2b3532f769442fdcddb0a8eac310aa416a83cd2d9269acb69
MD5 d17859ff4c4fd9e7deb16e4be286e735
BLAKE2b-256 139460e788fdb9fed14d22676260b9b119f4c558068a283299d27618a9d7f08c

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.4-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.4-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c9c33177c8425f85606998767ae7ab759cd2a70448d387aca83ac004ce163d4b
MD5 92a08cee2fd013ae4e953402e4113903
BLAKE2b-256 7b94e8cd9617f4bef6f7da5b0c0dd779e88e1e0d05a56a4e870dcca02b9587e9

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.4-cp38-abi3-win32.whl.

File metadata

  • Download URL: pep440_rs-0.6.4-cp38-abi3-win32.whl
  • Upload date:
  • Size: 165.2 kB
  • Tags: CPython 3.8+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.7.0

File hashes

Hashes for pep440_rs-0.6.4-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 7a50a47de2f773320b00782533b3d711dbbcc4a684aef9883418e6c56cdd0f1d
MD5 d6b97197f83667c196205a1dfd7e5bec
BLAKE2b-256 ec98df66a821fa7b4b982d8832e4b8ca1e8e050515b0e5032b97f18727396c9f

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.4-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.4-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7d6154cdf93bd7d2a7a60c197a47570a33bbd012e3aafc7e8fc03ca310174d23
MD5 e18940b4f7d3d6fa6fc63555cc6ea5a5
BLAKE2b-256 3407e390b341a603fb3b21b87b73f6d11ac46393e66eca58ba14dbfb7520afe3

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.4-cp38-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.4-cp38-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 acb250ed446a72ab3b6a1e437a277efdc7a0d7017f20ad1e4226f009b2c38b6c
MD5 c1fe5452b1247e7f55959ab7299b94f9
BLAKE2b-256 ac72036d2154824f01799d8a39c7991be4dd67aae1a46ac89ae195e9c9e00541

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.4-cp38-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.4-cp38-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 8a87564819b4d32aff2c6c3b1f79f32efd20fc0b8651d358f9ddfbb91c5d78c6
MD5 bd78ec4a9d87781dd473da923c1ccfd5
BLAKE2b-256 e18b3f2cad3268c7d227e5832630cbecb0ed823a9c85173c55a220426985c063

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.4-cp38-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.4-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 2ac8199e55df1c5d81f46789e3beb3753092c9351d6daa303b25cb6b1bfc021b
MD5 82fa4231768f453147ad04f8de32b7c5
BLAKE2b-256 5fea150dbdda15041c26b9348350e41944adf2c0f16b4dbf2a30887a2397999b

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1e219757d43d7017226a72e7cf49d4352efc99908a3c7173653be8fa67bbf390
MD5 69b64d207e66d6022409633d812fb6b3
BLAKE2b-256 16dea31456b76d970daea16aa1cee14783c1b2c66a7432781aac81bdb304e597

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.4-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.4-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 3d0f766e79e939a32c8d999b7abee95a174db30b0cb430f9820c2eca8455e948
MD5 d8a5e5cb53603e18d6fa1d33ae1b0d7e
BLAKE2b-256 b86f4d5012a580e1158fab461c44471b595b8eb769356cd546e1638ac3ccbed8

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.4-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.4-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 e0930b4c48081767761b6b23869ce95df4c9497db279991952d59566ab0cd8a0
MD5 cb211e41ee71c8fd28e58eb9d23065c7
BLAKE2b-256 bab2ef78ae4cb2fbad52abdff22a6e23af0ee00a36fb4711fd42e331ed8dcc20

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.4-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.4-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 eea2e6ae037ef79109a09ebcf2f884739415bcf14bf7752184cd94af00649135
MD5 8bd2fd48df331efb7054368009436483
BLAKE2b-256 80072a809efe8d9e074c55eac2882596d87cbab5e8212fac86badc9db0efdffe

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 357da4c40e5603dc5ee908ed2c758cd71231bb586c0e22f0d2f627aaee8f5a74
MD5 47fa767860e1fdd277e434bad7e37231
BLAKE2b-256 57f279d50bc2a4f6ec94d46e07d592ca9ad71eefa4aae17bf7f0b28451c288e4

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.4-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.4-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 543165f351cdcfdc88c0bc3b5686fe8dbaf5a81bee04d31a854cde3c619bf86a
MD5 f9e1fd02a31a1fdb49c7618c59eaecd5
BLAKE2b-256 2da09c5b91eb7d7444276bdb417098d8fda9c696a496f023ae88c3fa71767073

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.4-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.4-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d8cdf19a582c28b3a2d16e4b70312598c98f20ce19c982587171c9dac3d61895
MD5 cb839c75f8797042501ce356000d85e1
BLAKE2b-256 3a629394394d51f4a760d5615de93329903ba5820dbe5be098839f5a9b6f7edb

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.4-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.4-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 aef1f2f96971c298c3ab39747232b936880fef1376e711dafc593fc80372f480
MD5 3dcc36b1d9bc3226533a3a23b7305ca1
BLAKE2b-256 39b88090c70003c6bb9dc8963c7189cf9e2936783829a6365620464c94ce95ec

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