3 unstable releases

0.2.0 Jul 10, 2021
0.1.1 Mar 17, 2021
0.1.0 Mar 17, 2021

#384 in Value formatting

Download history 178/week @ 2024-07-22 220/week @ 2024-07-29 195/week @ 2024-08-05 144/week @ 2024-08-12 142/week @ 2024-08-19 97/week @ 2024-08-26 337/week @ 2024-09-02 161/week @ 2024-09-09 88/week @ 2024-09-16 133/week @ 2024-09-23 131/week @ 2024-09-30 234/week @ 2024-10-07 189/week @ 2024-10-14 90/week @ 2024-10-21 199/week @ 2024-10-28 100/week @ 2024-11-04

591 downloads per month
Used in 2 crates

BSD-2-Clause OR Apache-2.0

45KB
498 lines

pep440

tests

This is a PEP440 version parser library for/in Rust.

Licensing

The test cases we use come mostly from the pypa/packaging source code, and to keep things simple, this library is licensed the same way that one is: Under the terms of either: Apache-2.0 or 2-clause BSD. See the respective license files for more information.


lib.rs:

pep440

This package provides a full Python PEP440 parser for Rust.

This crate, like the Python packaging test file from which many tests were taken, is dual licensed under the terms of the Apache License, Version 2.0, and the BSD License.

The default mode uses a regex which is copied directly from the PEP440 specification, to do parsing. An alternative mode is planned for the future, which will use the awesome nom parser-combinator library to do parsing. Both parsing modes will be supported (once they are both implemented), and might have performance differences, but should otherwise be identical.

Currently, the following is implemented:

  • Parsing of version strings.
  • An is_canonical() function which can check whether or not a version string is in canonical form.
  • Tons of tests (copied from packaging.version).

Dependencies

~2.2–3MB
~54K SLoC