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

Uploaded Source

Built Distributions

pep440_rs-0.3.1-cp37-abi3-win_amd64.whl (469.7 kB view details)

Uploaded CPython 3.7+ Windows x86-64

pep440_rs-0.3.1-cp37-abi3-musllinux_1_2_x86_64.whl (742.7 kB view details)

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

pep440_rs-0.3.1-cp37-abi3-musllinux_1_2_i686.whl (732.4 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

pep440_rs-0.3.1-cp37-abi3-musllinux_1_2_armv7l.whl (744.2 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARMv7l

pep440_rs-0.3.1-cp37-abi3-musllinux_1_2_aarch64.whl (694.9 kB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ ARM64

pep440_rs-0.3.1-cp37-abi3-manylinux_2_34_x86_64.whl (571.0 kB view details)

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

pep440_rs-0.3.1-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (669.6 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

pep440_rs-0.3.1-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (697.1 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64le

pep440_rs-0.3.1-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (733.4 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

pep440_rs-0.3.1-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (480.1 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

pep440_rs-0.3.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (513.4 kB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

pep440_rs-0.3.1-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.1-cp37-abi3-macosx_10_7_x86_64.whl (537.5 kB view details)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pep440_rs-0.3.1.tar.gz
Algorithm Hash digest
SHA256 39b8cf30402ad597180a482ad73f46ea3c9c371ded3385a0b3ce09bb4c6675fa
MD5 9550cecf363384e35a18a8040a9ae81b
BLAKE2b-256 d08891ccc3b07866bb9cafb3cd22dae97d1496bd4295e0d91577dd9bb754b38d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ad129dac661199c013f8017fb59e4e1a245bb46e2bed49b674086cae90abb3e5
MD5 5da34f4de2cf4cba8aa939cc4814ec55
BLAKE2b-256 347eda39f9914964fe221ce23eb7f96d8d4e590a0ef0734f995cd982c37d5b8e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.1-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 af12d371322e053dbc24fa38fa3e059c70dcd3c30f64aa46fa835087b3cdb216
MD5 32ac8e9540a3e2900bf6a747dad078d4
BLAKE2b-256 626617491543ae7743d4f36cc85e38ba7883efad79e4d19c55a3bafd6f66dc94

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.1-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 969d63df3806b3617b4895f324c31692c7f39719c610edd43350614406352cae
MD5 b24758aafe70aec8adc2b6de98ee4b30
BLAKE2b-256 c676607c206b2335bb1ba720354c082247b3579cdd0f6ef5168199e6f7352cad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.1-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 a262c4433023d924165ac28e60984b483281c6818f514ffaf912f9753ef69c78
MD5 a74ef2d3a7001ccdea5506fa37c9747c
BLAKE2b-256 63176d5dd52a7f6cc2ec476986eca3b91ca23711da1dc630a8d54f2e9f9930ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.1-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 7d8d76640ec767bc154e1c44e88564cda07b662b34052373f4256e0522544bca
MD5 9865f551e2e3992afddd96091335a612
BLAKE2b-256 3146a7b4e65e9b73f0ca62b3594b14be53d8e6e97ccd5668c9f2851e25446b5a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.1-cp37-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3206127c992de4cb66b3bca422329ef154469287234bb66b9458ef56dce516b6
MD5 915f746ccc88a21c808bd0e9c7c3a617
BLAKE2b-256 e67dd2106444737f29002f416eba171befd647db837a119e17efbcc5850e6af2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.1-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 718e28bf31cbda068b67393c9fbe0f597175422c756b1e580245cbbdd1deb4fa
MD5 e1fb50e5c29c102c52e91b6609a0d069
BLAKE2b-256 944aec9d78194b63e26e70a26c979265545162186b2cebf9032eceb8aaa610f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.1-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 3284c5ef8beaf9214d571d8869dcafbe3c7238797fa146e5470a136b6570eb37
MD5 9b3d5d7595318a3bb54129b3deeecb2f
BLAKE2b-256 806caa5be9526ed37643f4d86851e85f79d8832aa5f41957b4825ad00a29ff00

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.1-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm Hash digest
SHA256 dc6fa7771d965d4cef9664f831e194a82295c231e195e02ff03dbd7324e47227
MD5 920e0bc25c362122a33c95361a1ba663
BLAKE2b-256 beba90a5dafd1d35bbbe4b0654854dd1885d5fbe302ec1bfccdc5d8902f13b94

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.1-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 4e1836100cb4c70ddfc3e23ee6f17b181926e3e3e182848b21a41aec442ea5bd
MD5 7df42838a4a17828ea1855c4ae67dfdd
BLAKE2b-256 f34dfe38309cc1181a0f016740f5223eda72885bed35418f01de0d7a7a88252a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 db165b746f99d8a3095e07e33a0142f3bf1fd7a12b0101156377a1d1db91e1b7
MD5 7f1d1c5d4673515225a27965c6a68362
BLAKE2b-256 e94e444a2bbf19818ba96d3bb108eae250f6faec04b9febdacef6dd8cee91e7d

See more details on using hashes here.

File details

Details for the file pep440_rs-0.3.1-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.1-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 012fe9a5e9902ddfef259390b67cedea11fb17f36a03670005183ad3392e7acf
MD5 d3bd22fce0637b2ddaf45e4ca4534bac
BLAKE2b-256 c77eec4d6de30873280c65b0860a0668fe0921614cb8aead1320a1b1eaf64ff5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pep440_rs-0.3.1-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 2eb0c3316134bb0fa877f24975cba5f23933ef56f9dea9a8ec7abe843e68738e
MD5 0a557dd8675679fda8726a27c58f51fd
BLAKE2b-256 960f7e5eb706754888b504cb33487585ba24b33413f0e148daff19dd658c347e

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