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

Uploaded Source

Built Distributions

pep440_rs-0.4.0-cp37-abi3-win_amd64.whl (741.6 kB view details)

Uploaded CPython 3.7+ Windows x86-64

pep440_rs-0.4.0-cp37-abi3-musllinux_1_2_x86_64.whl (1.1 MB view details)

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

pep440_rs-0.4.0-cp37-abi3-musllinux_1_2_i686.whl (1.0 MB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

pep440_rs-0.4.0-cp37-abi3-musllinux_1_2_armv7l.whl (1.0 MB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.4.0-cp37-abi3-musllinux_1_2_aarch64.whl (998.0 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARM64

pep440_rs-0.4.0-cp37-abi3-manylinux_2_34_x86_64.whl (883.7 kB view details)

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

pep440_rs-0.4.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (995.9 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

pep440_rs-0.4.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (991.0 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.4.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (1.0 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

pep440_rs-0.4.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (763.0 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.4.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (821.4 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.4.0-cp37-abi3-macosx_10_12_x86_64.whl (799.1 kB view details)

Uploaded CPython 3.7+ macOS 10.12+ x86-64

pep440_rs-0.4.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (1.5 MB 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.4.0.tar.gz.

File metadata

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

File hashes

Hashes for pep440_rs-0.4.0.tar.gz
Algorithm Hash digest
SHA256 436665f1b716dec0d3b612766dd3eb661cc1b2ff4047ada47ad4b77b8872ced7
MD5 b1be74991b17423c4ca2ca16cf3036a1
BLAKE2b-256 5fdc4b55fbab63073af0302c98ecfcbb80e43b241cb9774684f400f2b42544da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.4.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e85c0a35000c46cc2a5b964d7954f52a59d3a87566e3d85f739b5ec3441fe4f9
MD5 b3c996a646b8c9e00f55cf7cd2fc54be
BLAKE2b-256 24f1ada927aac2d2d21ca6f175b1e7525a4505a2adc5dd6039852dbfd2c5c5c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.4.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 eeccf83ffec71bc9a494e2ae3be05001aed581ba5ca1299035d68c64be9c3796
MD5 2f1906be8ca9703067be3bfddc52add4
BLAKE2b-256 3825d22545e97188fddfb860dfb577f9ed3f97fd50ef2caf82b51b04584666e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.4.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 65c0db1f067c3333713ec8dc816a81c92acce82ea7ef588675c13951efd31387
MD5 eabcea751a3a7150c7659a6dfc054f45
BLAKE2b-256 4106806fa76197c9adc1745cd8dc8400d235a23ecd82246ed296a26a2e0e1179

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.4.0-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 6ebe14e3775a616cf0e81e101da00656bbca67103d171a27a179663f8c6b49ac
MD5 bae366ba7dd2b6675d205dc8817c9b0a
BLAKE2b-256 bfa90fe0c73a79fe08360e1af8012b511e82c17de735299a4bcc3154b9b734ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.4.0-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c001ca6b1f029184df6b7fce734d42b9141086d70dc6caa2a23d632640a89ab1
MD5 df63a4a1a6aa951435059a180508c229
BLAKE2b-256 690fd3c6c0a7d6957ad0478e6aa968a87b3c805d4c4f959bf80da6bc847cb33b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.4.0-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 43dcc835abba4e1e6848950ed7cbef945e1fe9e6e1fcbf3836ee9d8331570503
MD5 3c3c72b67076c47472834b0bd38f29bb
BLAKE2b-256 bcef6db19aba16eb3872cf1b3a128dd371531955ad7cb5aeadf3f659cee65bd4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.4.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 a82ef94dd6dd9ef7a75535edf420b477ab1a3a880dda50b9fece6d58f8136901
MD5 5a54980879f63cd4739b1daecc5b0378
BLAKE2b-256 d4d4a6476b7ddfc07437bf2919bea58d4a0ff16c062c42d5b49c4136972d7626

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.4.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 c8736076d336408990aafa9ee74e1ac5f099aefde82aac5ed75b5b60542bd327
MD5 01edb21ef8e01cf087eaed9f569f3a35
BLAKE2b-256 d0064451a26e1244129c84aaf2258a3dd69577d301d11f3764a628cf4442ea33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.4.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 21cbfebe94dc501c6373e1001240ced2904060a1ebe66d753659ac6e0a87eb55
MD5 14f6badfd2d9361d09825c8ff5102fc1
BLAKE2b-256 d97ef270a85975dd503ef7b2bd6a73d1045e2dca4fe608a05dc46585e5b14a21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.4.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 9c3e18cd7b058a2db0e4d1bbdbd46acdac44f8b04ebb5f039db0fca01aa88be1
MD5 11d98d60212a289a18a4515e5b76f9df
BLAKE2b-256 2eceaa9a3bce834aa9879142e267e9dd581587a4cbac94c51a79a19bac0d801c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.4.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f6e6d8900a978dfd0571bde061477b390b389c986096f39e77963184029a54f7
MD5 09937a14c341615c4a8d0cd015e9fed2
BLAKE2b-256 8af276fb5263fbaf180a279ec7675930ed75c33965a886ed0c55b07e9eec90c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.4.0-cp37-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a85cabf11655212093732289753561d1dbbb284aa47851cba59ef89958164040
MD5 10f47ae8657d7aaa2c85a08d805e4823
BLAKE2b-256 5f7be3b46a676948b46c79bfda0b6087340dbf99b1b10c5b5522933a642538ce

See more details on using hashes here.

File details

Details for the file pep440_rs-0.4.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.4.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 d64088fde1633c46ccbaf5a455442c88cbed5abcfc491b016c2a417bd9605331
MD5 20e6018dba70fd81391d435cf870cf6d
BLAKE2b-256 5ee4239ceb359bf680797a1182a6e092c6390c5341e459c6d54db76ab66d0f72

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