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

Uploaded Source

Built Distributions

pep440_rs-0.3.2-cp37-abi3-win_amd64.whl (472.6 kB view details)

Uploaded CPython 3.7+ Windows x86-64

pep440_rs-0.3.2-cp37-abi3-musllinux_1_2_x86_64.whl (745.6 kB view details)

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

pep440_rs-0.3.2-cp37-abi3-musllinux_1_2_i686.whl (735.3 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

pep440_rs-0.3.2-cp37-abi3-musllinux_1_2_armv7l.whl (746.6 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.3.2-cp37-abi3-musllinux_1_2_aarch64.whl (697.5 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARM64

pep440_rs-0.3.2-cp37-abi3-manylinux_2_34_x86_64.whl (573.7 kB view details)

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

pep440_rs-0.3.2-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (674.4 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

pep440_rs-0.3.2-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (700.7 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.3.2-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (737.6 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

pep440_rs-0.3.2-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (483.0 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.3.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (515.9 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.3.2-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (1.0 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.2-cp37-abi3-macosx_10_7_x86_64.whl (540.4 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pep440_rs-0.3.2.tar.gz
Algorithm Hash digest
SHA256 2a426cd57ca90dd9a69e2b7d22537f64193499b273745973b05139292e28628a
MD5 6c8ca72d276fd62ea821e42f8900efa5
BLAKE2b-256 417edc23fd0a21690e7c5b4be64479c44104ca2e7253fae4ecd37168f1ed64cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.2-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c3375c79dcd7eac63776170d7677870d2aa7336a3577fb5e6b4c174e569f2377
MD5 b147e66d1a5816dc3bf4ef9228f371b1
BLAKE2b-256 bef19074b06f1bebb2bc72fc68a47a95ccd20b39165ec74140eb5a112c0f40e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.2-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ad36d61b1976c1783fee8ed001f8312d69c6cdfe4405e285691551a1206181d0
MD5 e7ccaddc2756bc901b35789468dc19a2
BLAKE2b-256 7ebb21bfd2dbfc109156a50ae54e382b4bf242c728a8c1983b4ace337406c3f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.2-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 32707573b5dfb7b44721f3f72ec40d614dd279f4fc31fca8fcf0b3f65ca0f9ec
MD5 2278b391bd569672c8835139be7f32ce
BLAKE2b-256 f54337f432fdc0103e07acd500efb07ad9ed962733e1810fc220f94ad0378297

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.2-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 a966b18463f5e27fee8673332502f6b0cf1f3fc19d13ebf376a82e0e5df4a70b
MD5 0961331f4811d42eb2ac5392d37f52d1
BLAKE2b-256 86b722bc11b87951fc0f30577acc913857ada82cc7a9cfe0d938266ea89032d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.2-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 1c1434d362f847f43e8b8da5c3d9e79e7ddb421323ea41974fa288f99dd72ccd
MD5 07a93d1f4428b050b838e22db15a239b
BLAKE2b-256 1e1a156e18f04f5089f24955981dcd420c56cb7677dd60b74d9b043a3fea498a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.2-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a65cefff35b4da8687ed0f6af6c3319a2b776c8f3b830ea02395267b7ef70040
MD5 a0ac88f5b2bab5d2bedb2ddd6a6bbcdb
BLAKE2b-256 3e4fd8613fd77fa89b0bd1f06accb1a3b7df0638f38afdf78c8027251598c39c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.2-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 d88b7f892d55416cdef45672aab56fc720830571114a3e7ce1eb8dc3bccbdd9d
MD5 9f919e44762842e7e0752f9ced6e7dd6
BLAKE2b-256 111d8a8d0fd9aaac0ccf51b986fc867e6e21e90b68db388637df2c64207ed008

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.2-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 ea07eb6a39e58a7834c53c2121fb790bf3f2b3987871e0555302870a6d80e37d
MD5 cac98334ea3dbb6968fcebe439f8e787
BLAKE2b-256 d840685fe51fc01383c8021f66a3e18ba01ff781eb64534147dbb8abb631b2f7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.2-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 0f9e8fd7c05edb3f6f2d98696725825b158aa5205595ac41497423ee6b278585
MD5 15b32237f5b6222bfe46984d85723032
BLAKE2b-256 310b5d46a9c3f9fec801a146800400e35c65dbbad6cb4d1020eb201f0b7aa04d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.2-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 a5e1517a4a04e0934a1c859e31700d69317ea27a09ac8a3115786d5762ace707
MD5 93e3e891bc45c47b1d50c68eafb9b572
BLAKE2b-256 622343b3f12f8964c771e188b7b1613fd1b3e07f727805aa6f1d2968a93df1b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a7a9364cec39dc21693843d13f7a45bbf598da5555d1ee2009803c4e6201cc9e
MD5 018a691b144db09fcec2dc7bfac63be7
BLAKE2b-256 b16ef3797cee0aff5eac3af30449b913da7c03c50147a19043f7faf36f22bdb3

See more details on using hashes here.

File details

Details for the file pep440_rs-0.3.2-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.2-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 536972771b6fb748ccfd355726dca30091b2b19b1b438acf053b36e67b060c2d
MD5 82bd3672b83590384965571352adbf98
BLAKE2b-256 e0f1ccbd3a20e41ff14c72456abca5730dc1b3932b3c783d95cd8b150edb10ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.2-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 c2038c116be3c102ce46386c976015c84c235a0f8a9fb555d69c2e7acba2eebc
MD5 3dc891025c17dbe4c0059230d6bc7c6a
BLAKE2b-256 68741c63a924e9f4fa0c34b9541148461fc07ce00d1de2b9fedaafd99b198cba

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