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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.7+ Windows x86-64

pep440_rs-0.1.0a2-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.0a2-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.0a2-cp37-abi3-musllinux_1_2_armv7l.whl (740.4 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

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

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARM64

pep440_rs-0.1.0a2-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.0a2-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (651.2 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

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

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.1.0a2-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.0a2-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (477.2 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.1.0a2-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.0a2-cp37-abi3-macosx_10_9_x86_64.macosx_10_9_arm64.macosx_10_9_universal2.whl (981.8 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.0a2-cp37-abi3-macosx_10_7_x86_64.whl (508.9 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

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

File metadata

  • Download URL: pep440_rs-0.1.0a2.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.0a2.tar.gz
Algorithm Hash digest
SHA256 e4640873b962b762f56d1db121fd64382bf7475778490aaf0c3e615ff3f1c5bb
MD5 974d0280fc76816769a1f673b8281626
BLAKE2b-256 1cb5f45a3e66e107e29b282d2dc76ae863d2f4ec468b5ecbc84d4f4e65e4fbee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0a2-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a5926ed71035c0b14c4b2b09b609cf3e2a7a6fe56e8dd6c3c0b05815879c0599
MD5 15a05a6aa13734b1edede540e05ccdc1
BLAKE2b-256 c73aa76bfc63bcefddadfbcec5117cbca729bc444d99cf289188495702494b11

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0a2-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0c2b7bc14672e0336ffde61d44e7fad6e3ab9b44a022713fb4301b3fe27e1397
MD5 9d85f118b24e87795fcd3dc6fbb2aa52
BLAKE2b-256 840e28a9ba416ff8cf4790f5d7360ae5666cc1b2a9d6306abfb5d0c2f489037d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0a2-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 35349a644c93352dcb6eb0bcaebbf6b93fd06292d969df4c7a6d8b1ea7b576af
MD5 6b6cd8431528aedb43c56d4a3cfee97b
BLAKE2b-256 0b32840962aa58e60793b6410783233bc09713e080137b79fc2be3c6d3f8d0ea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0a2-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 2b81e7374181a16366e4c9610d4281f3b8fc40b04b1eab9073a81dd5cd19c2f6
MD5 5dc1f17dc0eae434afaec072738f52ee
BLAKE2b-256 467f113fdc7d6f30c8d58e5d50695cb2a2ad7eaf77c9648a3bda0c7839bfb281

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0a2-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 a1004258f88768b2ba5c073f5af66cdaf2b0c0b6037e7928fddd72bd1ea01422
MD5 c1eaeb33235e8ac2cb29f54ca4cbd326
BLAKE2b-256 b612334ba0afc51041d937017c21aa3b783c6e84eeb053fcab2f8d4e85f87f34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0a2-cp37-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 09cc21d32c38c99d8bed2bf0185d339adcf4a7b89fce5b4ff25f51cad1e7538e
MD5 650fa336804388991ebcc69d25e05b53
BLAKE2b-256 8c709ebfaf8bdadfd41b509f0b8b8a9f9d3790319aab1be0a6fd211bd3a74144

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0a2-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 e1c0f9df4f28ca109ce95a4ec0f6f572c4d5be0000acdf4bc90c9a181e45c9b1
MD5 4c2e34bd05186b16d55aecc87dc3f003
BLAKE2b-256 6b9c41eb51580367910cd8eba4402f6e82384d8136ea41eac7de0ef568cdf92d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0a2-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 ad1b2429a3e71bcad322a1c5933032998b5b0767927d420641619591b0ff7a5b
MD5 2ba14722d700b8d26ad2037970e27b7e
BLAKE2b-256 6477e5d210fea07a236de059beefdd9b1788a1987f8b79395c87bb496f0ed21c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0a2-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 80412f2a28a83a491c70b977735717f6a9e346fe7074c9c621aa1909732fdbee
MD5 5de38934e4adff56579dcc2b4e3b0fe8
BLAKE2b-256 acbf0090ecc1e8bab440ad09cbe492f07a4d799302932a6c2187b735f7893cd9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0a2-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 4f26ce6d0ec9705ba5da552c8e327fd8c59c6e93e16589bff86c9bf0cf05aa69
MD5 5cf32e00ea9d82cd1ebb15c36f109203
BLAKE2b-256 129ffb1081fb5bfcebd46c752af18010759d1387e723b1868614483c0b3170c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0a2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9b68834132c4febe382f73c0310edbe7df2532cf55eed0e774fbaaa5c8c55a4e
MD5 f8a1d68ee3cbf06ec4ca953e0f55b55a
BLAKE2b-256 21c06864c953771f5250d8c53b81dc5482e3be2143819ab2dc8612a8224499c0

See more details on using hashes here.

File details

Details for the file pep440_rs-0.1.0a2-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.0a2-cp37-abi3-macosx_10_9_x86_64.macosx_10_9_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d6b6b7b060556fabd0faaca78299ac5f74508ba93afb3da9893d90671d49dcdf
MD5 551a74eb524cde775af6c8e84429562b
BLAKE2b-256 329080fa7489cc9576dd814befd43e2bce3c0f47b3969006c3aaa3c64871cc06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.1.0a2-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 98d804291a0fdc4becbdd69e3d522d46d547df85c4aad6bbc1a61b1a785c7f7c
MD5 2fd88a24713d45d1c6b2200439aa7a67
BLAKE2b-256 fd149d1e8c71b26f60c5844f26738eb558e385fdc43ccb5118c3e400f49e7890

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