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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.7+ Windows x86-64

pep440_rs-0.3.3-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.3-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.3-cp37-abi3-musllinux_1_2_armv7l.whl (746.4 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.3.3-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.3-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.3-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (676.4 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

pep440_rs-0.3.3-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (700.6 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.3.3-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (737.4 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

pep440_rs-0.3.3-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (483.1 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.3.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (516.0 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.3.3-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.3-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.3.tar.gz.

File metadata

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

File hashes

Hashes for pep440_rs-0.3.3.tar.gz
Algorithm Hash digest
SHA256 ce3422508a810cc6129afe3255732156e8b616a5cc6f6961b8d87f2f0f5ffee2
MD5 6e46f10fe304bd860055d6f76027380f
BLAKE2b-256 857621c0d6d78d5d02cceedd248e59a53ea54f8a84651a6c61cb931a3d069779

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.3-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0087286c8d61aabf3b181ff4ec5074ea69aa4501d9aa2b7be29729dc6054d662
MD5 8f0e48cb047eb597729931ae99c2232b
BLAKE2b-256 3902f5abb93791ea22cbc8f5f07bbdf3d6488a1bb52f6c0285ebf35714c08204

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.3-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 76b503582bb16bd1e62e431ff911bc88a6315567c59cfdbcce52d98678611def
MD5 255e273bff75f2f5ee967bac7ed404b2
BLAKE2b-256 464212e75a5fd860b9ddaa92f26d77b4108290a4296246ecd36214c1d04e0242

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.3-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 53cfd86cf0fb5d266db7ec04f596eb4cab7e7691aa1fa26620197a6128fbfe77
MD5 2ddbd2aedd7bac79630c4d75b28577fe
BLAKE2b-256 619a68ecdf102d365f8c3eb97f93586d984369c080a4a38d5110e1fb8dd34eb6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.3-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 692a72ef349927564594f2818b2f3708b3b56e71857a92f293a4f70fb2d02d36
MD5 d6bfb09df1b7111d7ecfcd3e91b61076
BLAKE2b-256 1674d7e1e2d278b96900863c7a2b2526377ddd1d37081a6a07f667d7659b9d03

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.3-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 85411a013aaed814a2db1418aba198d41531235e5cc034886de0f83ec8ab4587
MD5 4534c02812033ca32d35e26a4788fc20
BLAKE2b-256 fa72ffae64be0c6fded28a3c77470e9b3a6712651659c64d813b104a8542e24d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.3-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1f29233d8314721998ab5961b8d775a4b2b1e7b4be27be80792bdd4835f231c1
MD5 13b5c235b5a90b0de58a1d9968016e8c
BLAKE2b-256 cab35a2de715a8b8c2dc6b9af78178c962d7bcfc7866b90a2f93243c98a1ac01

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.3-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 5bbcf42e381edb5015defae6d3a64d6d1502e02d6b9c2454223b914c9135b437
MD5 efbeaae273ad28fa64690c6c074e6ebe
BLAKE2b-256 176a99af75d6873c441d128dd06921a513872c97f6bc3c4f5410455026094a90

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.3-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 823a1221178b574320eb7016a2af657504e813cba310b56b449bdacdc5f64a10
MD5 8e2dcd83bae895c369ad6328c3c7e376
BLAKE2b-256 cd2faaa40142148a14b5e03f78d7547601235fa1e22e1bc7d17eb441eeec47c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.3-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 a653ce8bb3f48eb213656fbab709eabec7ef3f640aa65e3ae4b7816dae193a91
MD5 677f63b6a5084d0893b7fb5bbb869888
BLAKE2b-256 2f8a5fa130c0409413886b78bbd09b29552ee243f10e6460a7d54d86e1e0d267

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.3-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 eff5ef7a1d1c1b72053410c06178f692897abf7d83cecf13a00f991dc2b8b5a5
MD5 3e522de4853d3671a0dbb59ebf7ac7eb
BLAKE2b-256 6cdfc750d09f2dacb7229156d590644b3381eb3804aeafb7a4921d9860d8e3b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3d97c19d503b4606bd23d6d42a5c2338b3911a4e94af87f48d93ec655010e92a
MD5 6ed0ef149d7564c191a7a51d0e519d1f
BLAKE2b-256 71deac0857ec088145ed3e10d171f0df95752209f07dd68511d5b3a4950e0990

See more details on using hashes here.

File details

Details for the file pep440_rs-0.3.3-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.3-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 584818a2ec812b8c76d9136a698ccadc227445317deb8e2a5fe34fb10fc9a6a0
MD5 ccb7eeb9c0653c18dafa5574b387437a
BLAKE2b-256 10a5da066ccbb5a7c61ba4b85cc38d4b11162d7a06525020998a3589f2527de3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.3-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 6be18dc84b8908db3e356f61942ee57cd66fbd93c24a6cb580714810bccc1dcb
MD5 c1062a4057627c3bebc7421408d5f30d
BLAKE2b-256 222cae0ff0ef0b63a3207f62dc63e77b01094a116d5c78b0ab96a1d974efbd9b

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