Skip to main content

No project description provided

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

Uploaded Source

Built Distributions

pep440_rs-0.1.0-cp37-abi3-win_amd64.whl (468.8 kB view details)

Uploaded CPython 3.7+ Windows x86-64

pep440_rs-0.1.0-cp37-abi3-musllinux_1_2_x86_64.whl (735.1 kB view details)

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

pep440_rs-0.1.0-cp37-abi3-musllinux_1_2_i686.whl (724.5 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

pep440_rs-0.1.0-cp37-abi3-musllinux_1_2_armv7l.whl (740.5 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.1.0-cp37-abi3-musllinux_1_2_aarch64.whl (689.8 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARM64

pep440_rs-0.1.0-cp37-abi3-manylinux_2_28_x86_64.whl (563.7 kB view details)

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

pep440_rs-0.1.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (651.1 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

pep440_rs-0.1.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (708.3 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.1.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (739.4 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

pep440_rs-0.1.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (477.0 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.1.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (508.3 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.1.0-cp37-abi3-macosx_10_9_x86_64.macosx_10_9_arm64.macosx_10_9_universal2.whl (981.9 kB view details)

Uploaded CPython 3.7+ macOS 10.9+ ARM64 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64

pep440_rs-0.1.0-cp37-abi3-macosx_10_7_x86_64.whl (509.0 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pep440_rs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1ef84530f1c2375c9186624cc3255f443c839edc2fa445f47b7b38b2db5fba2e
MD5 6264f353c27468f754fdbd40b555e6df
BLAKE2b-256 250d9e32a3582b2736ed86a4a97e2d85a546cb2aad1b354c5d96cd76fa3c53b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 912b4f888d05a66a5f9955a89134874d4a955a59383e917729f84147723328fa
MD5 3cd40e171b4bd13ccd3212d0240a65b7
BLAKE2b-256 7609b1661f55c7e2f90ed6a7ca9e72dc44906ffe16e77a1e616873ae5c812191

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 88188cea180b37fb5ad121510c41d812a02bcc7e1d0c8ddebd622b19e1c149ef
MD5 0153bd4f45eda8099444a1349509a154
BLAKE2b-256 d6fe40ec7b333fb4ed1f4bb2a37f0cfd3e6d88fa082be3ed0100fc8593f88b7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 1601c31db570fba75d66bbd345db74058dc74ba7232153f0b9a8e085b062127c
MD5 d7b9c9798325ad60013862c104170a9e
BLAKE2b-256 285d057412c9092dd1b499c3ec6f84d4f3310a55004862fb5cf67888ac209269

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 fe566e9f7c3f3fb44e61a6d1cff44fdeadb566abcc4ae5449ecd14accb13676d
MD5 92ab998e1b2231e834d53cca8955c726
BLAKE2b-256 7441ec92befa636d8a07cb49a6d134340e6aca60d039781dcb7032134a09ca0e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e5bc054582eea18fe2b8e0b0f3c17a087654e5791bd733418cddd3b7aa019293
MD5 65e423c2f1eadb65c4a9f9cf9d9e0803
BLAKE2b-256 2f3f457853f8b5ee005906f311981990fa4f8e6be21a3014549223ea6d8f17ef

See more details on using hashes here.

File details

Details for the file pep440_rs-0.1.0-cp37-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pep440_rs-0.1.0-cp37-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f3d1ac34af1a5d590547240ec28748c3cb5ff9e553f229d44df97969ee59928e
MD5 335361d8a4c498ce4967668d0b4a0bd3
BLAKE2b-256 84d67adda91de383f6b7527e21a4778f10e0eb0909402919b1de6ef2cae74a8f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 261c5eb976a204f8ba8e9369150bfc7c7868b2815c79a14b66f2be4301f4549e
MD5 aeadece73f23c1b2a3d4dbe454213145
BLAKE2b-256 f9ec11f00da9ee609a6e5222ff774f4dc333e98d5bce479e37deb6b373e47756

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 177510ebde0449207f80dff7e34b54caaed17046966fa8a8306c3ef06bf4c255
MD5 6b9e2c592fbbc56f3aca9974da38238a
BLAKE2b-256 cd16e63f43eedc7150d674e117053bbbffc6234f8521002f985a77bd083b2863

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 7f2ed79c182c7345b829ce7343c00747376c5baabf6974b2b9b75c710e1ba401
MD5 4d00b58692d2447c9b418ed681aee853
BLAKE2b-256 93e9214ed5fdc4b2557e7ca9417c03c78f378dee0102db75bb9a67c43a35b7b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 69341f4c9326c38c954e3690c36e52b74849b8b2fb7d321ce64e9391e4bc696b
MD5 235cb1545714c8c239bb83a0ebd826f7
BLAKE2b-256 4bef0c37e074bcf2d33abf9ab744ab1f36e56e71753b95dde5002c669480e5e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 086c55e77c9446c65649f71f37f50496d97774d5bc6c0fd014c173b4823fb41a
MD5 69167332baebd03628b0fcf4f5909f71
BLAKE2b-256 9c5745110b4fd9dc966190847608b957965f86fdde1e825377a19d4ba51e0e92

See more details on using hashes here.

File details

Details for the file pep440_rs-0.1.0-cp37-abi3-macosx_10_9_x86_64.macosx_10_9_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for pep440_rs-0.1.0-cp37-abi3-macosx_10_9_x86_64.macosx_10_9_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ef5353a8b70afc4ac5f8c1fa5f82d423b6605b102ead19aaa01e68c5505ce8e0
MD5 18af715d1c209b9220d11864511fc60c
BLAKE2b-256 ca68968dd37ddeb662484657f871339d6dabe02fa83c147774a7d9359c6fb832

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 4c18d8fd39bf464d299836038a9217c536ed3e513d147f95727e68eee5b9ef2a
MD5 fded45c60337bd076887d889610bbcc6
BLAKE2b-256 e0d3cf3018621e5be839fb8a61f5b267edb04c5a6f9fddcfe11a5525140f6056

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