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

Uploaded Source

Built Distributions

pep440_rs-0.3.9-cp37-abi3-win_amd64.whl (537.8 kB view details)

Uploaded CPython 3.7+ Windows x86-64

pep440_rs-0.3.9-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.9-cp37-abi3-musllinux_1_2_i686.whl (804.9 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

pep440_rs-0.3.9-cp37-abi3-musllinux_1_2_armv7l.whl (810.8 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.3.9-cp37-abi3-musllinux_1_2_aarch64.whl (766.4 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARM64

pep440_rs-0.3.9-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.9-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (745.8 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

pep440_rs-0.3.9-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (771.7 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.3.9-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (806.5 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

pep440_rs-0.3.9-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (547.4 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.3.9-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (585.9 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.3.9-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.9-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.9.tar.gz.

File metadata

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

File hashes

Hashes for pep440_rs-0.3.9.tar.gz
Algorithm Hash digest
SHA256 fc54ea94f26fffe474d0004f963aa5d53acdcf523a7c8259af43e439f9ad2b9e
MD5 43c83565df52fbe90739d454c706e318
BLAKE2b-256 ddca369ab49b453acff7e3fbd971cac27bef4e93e959c049989fc58594558f2a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.9-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 bc4d7e56de5fbd9b374032c2af1f4d018211fa61a8966f64876550a2428fcb48
MD5 c18a900e3872d429f63c9c31022c2e64
BLAKE2b-256 a0aff4cc1f47171d92be1faf09a37bc21f6e2ffe11d6ca1931002bd0412b2a78

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.9-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6e21127c65a2ab6627d2492f1ddeffd6b4da4fd978aa7e13a3c0fab736fbf215
MD5 0375e36d877cd20513451316d37df57c
BLAKE2b-256 fe350d49d117198d315a948be559189105abae1283517d2e3ccd30840631aaaf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.9-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 325637f7dc75742516a17c633976413b7266b7342c4bdd4d0fbe975cb3f7f372
MD5 79b1aceac1f3e0efb06c08c6b2ff5e95
BLAKE2b-256 7ec314621efbb1dc95e66e86cd0034bb834c3bd52cfc0497472a1bb18934495f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.9-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 96f0bcfd9b7e5c0edb9373a9c2f8e11e22e088338276c896cb765f7193b3eb41
MD5 a286bbe909339c22b51a7b04bd1dd571
BLAKE2b-256 ab9b6e2ff318630bcab443bccc6c7edcbfdbafbd907128bcec19ca6b2e7b7edb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.9-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 fec496a30622a7b9ba76b3b69f82af3d1d9184c05948a6468cb8baae35d35e90
MD5 84d3012b8f3ae3fb9d7333c033ad95c8
BLAKE2b-256 d6621eee0ef99ad5ba5313fc10806a9c39c084b79f1487679ab87ead319c726d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.9-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9bebce237cfaea709c67b8dc99660fa0e8235bab9b31a5bb340ae8de18489872
MD5 7d1fdb687c125ccb4da57526fb140967
BLAKE2b-256 cbb3ec968b4420537be831d53e2bc49c1168eb5a24182dd282c04098ac4b2cac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.9-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 5e86836c7eae84b942cf82e939df33a9ab7ebdf0d52ad94fbb5efb108ffa8216
MD5 064114525351fb0fcdfc97ccda334429
BLAKE2b-256 494a7e6ea8e5f80f6487112f1f6ca8ea682ebf8a5e3417dfb8ec327b771cbcb3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.9-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 6d972e0ba19fb1395a8e93296db36d71ed2e9fd29b11bdba84f2f70c91df13d4
MD5 0aaf27727d4bdbcb29b57f0bb26a7dcd
BLAKE2b-256 d6445f7a2e911a1577c402d10478a09c3dfc25b4c548c195d63d53f9a19f8a8e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.9-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 c4fde1a2f4c2d25dce32867b8d2ecb341e4bde6f675485af8194169efb83e601
MD5 14898b3d9203abcac2ac046578094d76
BLAKE2b-256 97f72cc8c099c93bb1709a5022ac0e467dc50af6a71755e4c14adfdb9a32bc57

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.9-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 76d00e1251a11664ffa7583534a7a2da88721fcbaeac16e2c994857a24f11b91
MD5 263325f05bf9a986d509908898c25c72
BLAKE2b-256 997cd078615d90fcb8dac9191b17d72e8afb187c525fde9d58606133bfeadc9b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.9-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1124cac0cb55d90d8f20a7b69af556ee8649ffd27419c59aea7f11d9e8e1c935
MD5 914aacc558c5e83800376f804db2898d
BLAKE2b-256 47d1870ef94f99108a5f36056917bbd494056fa81aa723154cbbe8eafb0eda5d

See more details on using hashes here.

File details

Details for the file pep440_rs-0.3.9-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.9-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 739e0d79e30ea4f06369f0832ad0679eac2fda7ee230407fc8b7091d6bbeee8e
MD5 124f5bb86e0eb7d0759ebee2543b4e7e
BLAKE2b-256 b7b18f738046fe4233d5d49ca73f066e8067e797cad3029427ccc5b14b980fb0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.9-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 02b4979be195cd326da3345421365b0018fd9905e8976019d756f8d327250499
MD5 c4c535fd7d4b9afd1326041419bd202c
BLAKE2b-256 331146d92c9966b0ba5c9122cb071ab41d8e1818dd1398e41e213ba94b6ec58e

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