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

Uploaded Source

Built Distributions

pep440_rs-0.3.11-cp37-abi3-win_amd64.whl (532.1 kB view details)

Uploaded CPython 3.7+ Windows x86-64

pep440_rs-0.3.11-cp37-abi3-musllinux_1_2_x86_64.whl (802.9 kB view details)

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

pep440_rs-0.3.11-cp37-abi3-musllinux_1_2_i686.whl (799.5 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

pep440_rs-0.3.11-cp37-abi3-musllinux_1_2_armv7l.whl (815.2 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.3.11-cp37-abi3-musllinux_1_2_aarch64.whl (767.2 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARM64

pep440_rs-0.3.11-cp37-abi3-manylinux_2_34_x86_64.whl (637.1 kB view details)

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

pep440_rs-0.3.11-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (740.7 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

pep440_rs-0.3.11-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (772.7 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.3.11-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (809.4 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

pep440_rs-0.3.11-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (551.9 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.3.11-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (587.4 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.3.11-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.11-cp37-abi3-macosx_10_7_x86_64.whl (597.3 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pep440_rs-0.3.11.tar.gz
Algorithm Hash digest
SHA256 609b58b3b44a2ee931e830016ad2eb49903a982141d778dc32c65c923d73aa2f
MD5 8d4b38b0ab9434aedcf87aa07db85df0
BLAKE2b-256 ff4c4ff2ddda7b3095d85d1bb3a2e8ee9baea6a9fe915f42664c57c6ccab0b13

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.11-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 616e09673ad217776583ce86de8da32f507c38dd6f8b39baaf8e10923d75bc82
MD5 4e1b1c6f3e0bba8b6aae2a211e0c1d3d
BLAKE2b-256 32d1aef43c9034aebe473c5797698833b681fac43d8d1290ee9d5f906b38cb6b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.11-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5fb8db6b40b5a74c1d6522b6602a9a31a2d7e66129e830c392598bb140dd8566
MD5 9576220ad34e3faee99b54109a5bf79a
BLAKE2b-256 7bc5bd3dd8c8b1f6aa651cd2e67feb4b3e7f0051eec091ca95855a2d1ebe2cab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.11-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 7539db61560e7578efb9bd6f8a8954d7c7d236ae42ca729bb559b7b5c141da83
MD5 1b73ff36c95fb80640dca25614c68265
BLAKE2b-256 1757da4b349fb7c9f9f39b8ee3b8c065ab56b67aca3cea063c00ce19be1a9df6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.11-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 514ed3ff9fb38961d4971d1380bfbc442e1d227800d57c48ff65a2ad837f54a9
MD5 5d192d7853da616d01ffba1e88595617
BLAKE2b-256 da5aebd7e6393813f18ab52bd747266fe132ec5c73f9722769c147ed9d7a5eeb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.11-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 2a4dcb2ee6d231fd50456a85a7704b86e733962db864420846d738b4cc34d075
MD5 45b3d66a9147027a002bbf14246851cb
BLAKE2b-256 ae3e35f93382c37c89d263ea8ac3263f705fe583fe39a834164521a2412cf5e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.11-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 73e1ded247bf4660c2317ecfe2888863db30c846c1f96f40251a1c15ee93be46
MD5 70beca224a1545b76f947b7632567ece
BLAKE2b-256 da197e3a2847a4f2f96218230e380f15a93e89fef5762115f8ecee40e10e85d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.11-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 dcc8991fc5792e3d0ed688cc89ffe142c9a5f7163dc372d701a5fab8e1db3ecc
MD5 d8a5caea1b048734f28bd6878895e746
BLAKE2b-256 b2051e13edf92e3754c46643d86bbc7c64e3f5d7b9d106f4282f948ba1cfe032

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.11-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 59d1323fe405a3bbffb6421e7b76e6530ad0e49386f2efa76fd2c7158d64999c
MD5 014a80dc47cf5d4573e55cd74aa2a1f3
BLAKE2b-256 18d0ee79d1ec0dcfebb466575a752d72030c4f6e44d20f9d56357524c48bf788

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.11-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 d3d614e22baa586ab2d2a0e3f3900609f5a13721e404def3a07692cc8c9aded3
MD5 03101d786e25b479df121196be330551
BLAKE2b-256 94aae074b4537c5dc0a9110ec4f26fd1db22e7104f8430e776fc4fadce760a13

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.11-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 bb28d4591de377d3fe4818c0ce501f046406bd9aafee6cdc7964d655f04bb3c3
MD5 9b5736265917a77b9c3eeb0ca502a195
BLAKE2b-256 6b52f7d67ad28136775d21963183d5f25556ee481d100a2a80b362659b99d213

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.11-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7ae1b494c6f32bc20fc88fc614d4693a1079149b92e9833aab77b13fa754e984
MD5 110de1a77b1561cebbb86a623c37c503
BLAKE2b-256 5eb080f0b3ec46db01da1c424124d0803805e7c05808245a7c0c0d18f2e5e032

See more details on using hashes here.

File details

Details for the file pep440_rs-0.3.11-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.11-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a1e42f1b2cbcf12da7adb4a5667d91c186e839c27cce36597a3704c91a8bf8d4
MD5 03fe596768c1dde9e1e7d5d9a54fb6c2
BLAKE2b-256 54664f50aa37c14a772052062f1fa0243ba3a7bd7115eee6e1b10b13148dfbea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.11-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 05404c5f7d4eb198d4c5eb1b4d8a826035c2cf880355c418d0790946f28d50cd
MD5 dad6cb3b77d47d38ef0d5cdcf7e6e733
BLAKE2b-256 f3ad5dbfa0512589d7bfc498623fec85a0cf959a4bdac1fdc5101dbdf97a3d0f

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