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

Uploaded Source

Built Distributions

pep440_rs-0.3.7-cp37-abi3-win_amd64.whl (537.7 kB view details)

Uploaded CPython 3.7+ Windows x86-64

pep440_rs-0.3.7-cp37-abi3-musllinux_1_2_x86_64.whl (814.4 kB view details)

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

pep440_rs-0.3.7-cp37-abi3-musllinux_1_2_i686.whl (804.8 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

pep440_rs-0.3.7-cp37-abi3-musllinux_1_2_armv7l.whl (811.0 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.3.7-cp37-abi3-musllinux_1_2_aarch64.whl (765.5 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARM64

pep440_rs-0.3.7-cp37-abi3-manylinux_2_34_x86_64.whl (642.2 kB view details)

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

pep440_rs-0.3.7-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (744.3 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

pep440_rs-0.3.7-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (770.7 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.3.7-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (806.3 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

pep440_rs-0.3.7-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (547.7 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.3.7-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (585.5 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.3.7-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (1.1 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.7-cp37-abi3-macosx_10_7_x86_64.whl (605.2 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pep440_rs-0.3.7.tar.gz
Algorithm Hash digest
SHA256 01ab28db15a34fcdbf54708957f5878f1f4707e24c7e33772dd7e349e58fc06a
MD5 a866327bcad28f20bf0f2973ce62ae72
BLAKE2b-256 58473efc008e3f3c9c24b5e1420caea0c3c91bb5615c49b618455b265145e079

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.7-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6856e5d4a7541576b657f8c981d65a4758fe982be657e1ab721e0c35085ab161
MD5 1b0a27191244b69b7a0aa233a5150740
BLAKE2b-256 de7e9a9f7dde07efdffea4c8886742fdb9a902260087d6c43fc8372584ae76df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.7-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 dcae5b0b587ba0422edbcb0777c24df05e9533e0fb0475f1f5c1736b5698319c
MD5 0034d19bc0d7d2913978b3de12517bdd
BLAKE2b-256 d4d86d0790fa72e7fa35a86dd7571a882bf644d1c67e17743b0036547f1e472b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.7-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 49ed506ed805332f0c72747a23d2b39efcc8902ef5d58c3eff61f350acdc90ca
MD5 0e179cc93bc334777aa688a002d390ad
BLAKE2b-256 81939f5d0d95f145f1d402ed2a8a0f6afbd5a9cdd5aa5ea11f2392acf724e6cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.7-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 d30f74877c054e84d71d8016248aa03f262a142d2ba86651cb52428504b750e3
MD5 085cca680e4e65d7e3848fe32f1672b9
BLAKE2b-256 e1e5dbb2a622511eaa468150608b7b5d0100b22e5fbc6e63b08dd6170dd41ed1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.7-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 88f9105f99f1668cf4271e8f2b1990ead9dacebd4f8a23b34351946a59dd6077
MD5 11a669584773851f69a282fb580e4087
BLAKE2b-256 43994b0a5fef175e88a1f146615d157595093d286ec8590daa0c90bd2478f7e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.7-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 dfc0730a0135ea885d9025315b8adef3b89b00abc1caab197cc6fa0d3dc61cab
MD5 8c8094eb89b9a3ee6b57493d9c20b351
BLAKE2b-256 1a5e7023fecfabf1d4ccf26184113aabc1f61962108aaae8415e696e7b45584c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.7-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 0f4f8b28db3afdcc61608dd324002aaf8be58ac20c75da83aa4461c4f0159e5b
MD5 816d43d44ea18b16fcf6314db467c863
BLAKE2b-256 0328b42edc38bce0cbeff52b70d7001f4da0d8a79b4a92e923d78644d5dec62c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.7-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 13eed67dbbabbd2a9dc80f978d0cfe3709bd59c7d5f921fa7bd4e5dde4363ac4
MD5 a17d22c2b4c0229f79456eabb7867278
BLAKE2b-256 d369ee0edc113010e0d5cbc99632458e70835ca7fa0398a82aa120ddd761b382

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.7-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 57ceeb7838e5a1cef1c2119479e2d1bf3de35aa2a9e6c4fc83de7a2762f133ea
MD5 220d13ff90f70add44047b625611702d
BLAKE2b-256 02d1c513557ef771fef6e092252e92bdf9304432a5f4822495f91b7f45d48dd7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.7-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 91af1992da8ab6be40bdef1002e74912ceefc2d9e108cbee4aa802766a888a6b
MD5 d33759eb50303405568d772ba0496b09
BLAKE2b-256 f3b2a39016e36d853166a7681f2cd2fd7601e666ebbe2d6034677cb9dc0815ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.7-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6020817be15d740e3d985fa3e3f655bfcb6caa4157ca31c5668a379efddce0dd
MD5 29141cb1956a2720b1f495e58a50f207
BLAKE2b-256 7eece03f99895a9f25c6935bccb0e116b37943b087881e23de2bb498b973e46f

See more details on using hashes here.

File details

Details for the file pep440_rs-0.3.7-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.7-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 4b7669cde25915b65a98dd28a5064e78c4aaa7d00fa9adfb2a7e20567417e811
MD5 dfe6cd74080fe7b4b3a47b6448ec8f3c
BLAKE2b-256 38dfe9a9b53bccb661c0b33675034e088cd1f63903b616a2ac83a3e91c3138ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.7-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 bf506ff76ce96b6d243beec6bee9f7cd6cf1b0f9251b9e5b68d1cbcb1a0afe7d
MD5 9c5a13d7485685482e248e5f07773f4f
BLAKE2b-256 c2623fcbd7b3f44165dbe97060f4fd8c3a7fda00c1699d05b744d5f06168fc95

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