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

Uploaded Source

Built Distributions

pep440_rs-0.3.6-cp37-abi3-win_amd64.whl (536.9 kB view details)

Uploaded CPython 3.7+ Windows x86-64

pep440_rs-0.3.6-cp37-abi3-musllinux_1_2_x86_64.whl (813.4 kB view details)

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

pep440_rs-0.3.6-cp37-abi3-musllinux_1_2_i686.whl (804.1 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

pep440_rs-0.3.6-cp37-abi3-musllinux_1_2_armv7l.whl (811.1 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.3.6-cp37-abi3-musllinux_1_2_aarch64.whl (762.9 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARM64

pep440_rs-0.3.6-cp37-abi3-manylinux_2_34_x86_64.whl (642.3 kB view details)

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

pep440_rs-0.3.6-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (743.2 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

pep440_rs-0.3.6-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (771.0 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.3.6-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (811.1 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

pep440_rs-0.3.6-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (548.2 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.3.6-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (581.8 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.3.6-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.6-cp37-abi3-macosx_10_7_x86_64.whl (604.4 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

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

File metadata

  • Download URL: pep440_rs-0.3.6.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.6.tar.gz
Algorithm Hash digest
SHA256 a350f1efca1854781aa704d47311449f6fdc046905a0ec13ffb90f521e62a617
MD5 f7187f3c287861171ffa8e853cbaa68e
BLAKE2b-256 736e16fa15506f1e33f229feea6e94087397b92587f1bafc0bd70ab81ae3e7ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.6-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6e9ad813ceb5f3646b08b8d735e35d95c7c163ab8018c8b2540d92336b85766e
MD5 df994917dc00b0d966b2481c88cd9465
BLAKE2b-256 e2a714e38c87900e4bf2947d467035bd4e707ff70bcf9d039a43fd5d24011cc5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.6-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6d7de76e59dba55888bb8ada35289ab6ee5338bec5016b537d0e3687769a53a9
MD5 742a661ebf8350db6040a5154d78f73f
BLAKE2b-256 0aa8c07b79de41adf4d4a6caa69910a511c390bae6eccc88e3d8150856d5380c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.6-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 2488a6defd414b5d7d792cbc788b4936c76002d7f4fdbba32b0f67012c764702
MD5 862b6cf39c8c0cb6eb274efd032ff6bc
BLAKE2b-256 7b1c48855ed7f825f5e26b70848724b85899bc5103e6dc958a39f3201f50d0c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.6-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 45a570b5ecda37b6d5b1e05cbbb8fff6192115584f240a382139f1294d0b53ea
MD5 4101429f563756a11998a40a2213496e
BLAKE2b-256 44276296eb5000990e44dbc1df63dc4e089774caa6d0dbc739c4b7af11a40318

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.6-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 0254ebfbc11b0f9133e58aeae33c794abefc13f36881f861f3aa20127053b281
MD5 794a3108edd5a098e4acb5bdeeef0db0
BLAKE2b-256 37f70d5588ea6f5dd2bece909e6871a0de44321f0c57ca64854158e5a888db15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.6-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8a018d70180b8fec4ed7b94bc2ee60f0bb92d9e185c4c36c2785bb4bdcb6126e
MD5 834e046d1b4fc380603ef520bc9587d6
BLAKE2b-256 8e0279b1940742476f20318de1ee57adeb9865a84214e603906ee997be9013c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.6-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 066789d6d32693afcaa63df6a025b34a29fe555170c48ee8e0f1fbe6e2f628c2
MD5 a8f413834aadfd27ab52ea58e3d6d9d8
BLAKE2b-256 b72d97687f62419b6d9c36ad06504a36922455da38a60ce71ed816566a30b319

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.6-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 04dc18dfbae7d27dd72d32c605ed3e268b99448a03528a308428b01709c4ef5c
MD5 92f6eaf4dc2dda6c7b3ab73a60a320b7
BLAKE2b-256 b4b87af47d37aca1981358481a71a50ccf3ad7d72a709298558c9f237da72dbb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.6-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 97e7ff2008c508e6b435a256647e7ca260148d7c01895b061e0de891100fa50e
MD5 0fd750da35cbe71477d74ca60864c080
BLAKE2b-256 337aac137c07289320404755ee92a8bf330f916f8a004d900539478ac7f3c0f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.6-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 2dfa94e41307681b11b145879c385616b9a4f4bab28abf40763c24d16b21b92f
MD5 b63f55d88dae78c682c56671d55429bf
BLAKE2b-256 5674088995f80b5eb0b41d8be441f0400f4a3253dc66ffad8e80aead97b99c6a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.6-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6037d267b8db1d89ac324c4a5622a8afa31ed3ecca46ba252493963b6cf12b93
MD5 18c535f66a71ddbd1ea7b8fba58d7be1
BLAKE2b-256 beb7711ae1625e19ac3a0de079d0708b75a5df013e9ddf03f2514e733eb062f6

See more details on using hashes here.

File details

Details for the file pep440_rs-0.3.6-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.6-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b59a51ac9e7f6a2b131d6588c2a86bf3d6fe6f25bb487529634a365798262b36
MD5 1078635f861d064d7310fc2fadeda6d9
BLAKE2b-256 7a035a0283cf7ca5078989d820a4b36814d5100b55815158367e43ecfb960e5b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.6-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 8e4a604469ef5cdcd8f1c3fe70a80f8f93f7d1af05ff205549590e234c703f29
MD5 4d6313ed43e3b1e419baccb96ffc3a52
BLAKE2b-256 45b265825b50f935098842d9956228db22a4cce5422a3c8f3fba1de406104f8e

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