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

Uploaded Source

Built Distributions

pep440_rs-0.6.0-cp38-abi3-win_amd64.whl (176.1 kB view details)

Uploaded CPython 3.8+ Windows x86-64

pep440_rs-0.6.0-cp38-abi3-musllinux_1_2_x86_64.whl (441.7 kB view details)

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

pep440_rs-0.6.0-cp38-abi3-musllinux_1_2_i686.whl (466.4 kB view details)

Uploaded CPython 3.8+ musllinux: musl 1.2+ i686

pep440_rs-0.6.0-cp38-abi3-musllinux_1_2_armv7l.whl (594.2 kB view details)

Uploaded CPython 3.8+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.6.0-cp38-abi3-musllinux_1_2_aarch64.whl (509.4 kB view details)

Uploaded CPython 3.8+ musllinux: musl 1.2+ ARM64

pep440_rs-0.6.0-cp38-abi3-manylinux_2_34_x86_64.whl (270.2 kB view details)

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

pep440_rs-0.6.0-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (392.6 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ s390x

pep440_rs-0.6.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (361.4 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.6.0-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (373.6 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ppc64

pep440_rs-0.6.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (332.0 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.6.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (330.6 kB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.6.0-cp38-abi3-macosx_10_12_x86_64.whl (241.7 kB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

pep440_rs-0.6.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (474.1 kB view details)

Uploaded CPython 3.8+ 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.6.0.tar.gz.

File metadata

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

File hashes

Hashes for pep440_rs-0.6.0.tar.gz
Algorithm Hash digest
SHA256 1fa7ae10d7b04cc4c59e30654d3edd9aec87b78a0e6194addc57ebe88cf1ea85
MD5 3d69cfdbf599a91b8c9735c722d6f146
BLAKE2b-256 2a796c051018af265aa7c828fd89536b5ec3b232ddb81157edf1cec279b39a75

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.6.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ca27880823c0361d9497fa27ab461e43cc723468752ce1e16ffad5aa92a0954c
MD5 1976e574f49d73fb9416590b5ba59f71
BLAKE2b-256 3c8b81765fcf3b6413a8b02be523e5711935237c96905b22547b22d1f0416bfe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.6.0-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 873e27cd31f2f67349f0f3540018710728dc79b3dc9e5cec7cdafb8ac9520a16
MD5 8fdeeadbe0be75e0ecdfcd242be1b256
BLAKE2b-256 9c614f32ccd62703d48916b7cdf5d07fafafbd37ea18c05cc7e1231fa3f9928e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.6.0-cp38-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 292f08f356cd1c69152f691de2966f9c7cfd6c52b4d0fbfa3fbad6a2a72278ba
MD5 4a9353cf079e096344c1b36f3c91c655
BLAKE2b-256 b299e8f0ca6e7e477b40c7e4444d0d53caa76405af5e8de76eb0a667743eb6a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.6.0-cp38-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 c6ea454023491f1920ec20924b2d1fbdaf2e1eab1615db37392152e403525aba
MD5 2178a3c9f3e275daf44db73878f392a1
BLAKE2b-256 5eb1ca066bad5b3d923d3a83ecafd9ed4cd7df3b8c4cf16a8deab36c9f408bb5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.6.0-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 82221bbfbf5a5bda968923a0b81d8d5889adf30b5264e53b2fc4cd42f5196904
MD5 6d926e91b264d5e91f1c4203815532cf
BLAKE2b-256 233aa9b4502f667faf2e82add277a4902c3dcd0da74002b6932343bcab7dd3a0

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.0-cp38-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.0-cp38-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5db28a6fdfa3916f2cbd658ad41d6c7e596a4b36272ce37d45c3c0dc5fcf9227
MD5 0bf615008045127bcb17e72075b93abb
BLAKE2b-256 99269a7c919dfd62cf68246c5f701ef778add12758f85622b414faea31674041

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.6.0-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 24a911543fff5bf4f2076f3fa08f235e814ea74e32db04256468412a766fd956
MD5 3055a81aa80677448130c8dcc6fdae8e
BLAKE2b-256 c35e8bf13b79f71fadf874bad2a6d5ad28b3a77e08320010f11ee4c2028cf593

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.6.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 2508fde6dae1bb531a64742c96a6f3f58647c8fcc96b239f08bdaeb7cade6d8e
MD5 465fea0061f38200b13db95837b1c6bf
BLAKE2b-256 95144f5ce8c46a665725e3d7e2e27d959afa04207c658b3972a2b4d219b0a626

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.0-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.0-cp38-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 8b8112afd70553ba5ca6347bdfa018427d917b50ce9fe7993d063695202785dc
MD5 c7ccfbfd93760556917d91b1be6993c8
BLAKE2b-256 7cc874ac00dafc6bf705135ddde0bff6b64361cb995857a27bdb4fde36006d15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.6.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 dee632b769987709fa825e94fc10adb5266cf512a3bfaeb1c26daf99dd105fb7
MD5 6f80dc00b86494db7c2425431429642c
BLAKE2b-256 d41077c3f9ea97a963ffba92522a088658bd7c93307a015c7edd254636a15450

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.6.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e8c986612e161c3b4afb34ecd66786723550a33592096f72e661292f43ad567a
MD5 275b9e8e5c1f89fb950f72c262a412bb
BLAKE2b-256 d11a1b74f4175f508e5d4f51ee82d23abf404cd10ad9cf247ce2a5186069d113

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.6.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c87c6c6958e238c313d5eb12eb0234586771aa0eb5a33352bdc7374fc4df6991
MD5 e81542c0e77fc98a1e172717aab65c8f
BLAKE2b-256 e6be29112e7b48d436c15d9ea03d2cef8de0d9bbffee8decb490be5ebee3276a

See more details on using hashes here.

File details

Details for the file pep440_rs-0.6.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for pep440_rs-0.6.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 30d1ee34a119c938e437656ab8be6b4bf30c7dbd4f745edf8c871fed435543d4
MD5 0fb7abae6914778635250e1d11efc0ef
BLAKE2b-256 f9fc0e5f13e7416c3930ed8321b2ef74f13a36adf0ff5495c0dabdb015261623

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