3 unstable releases

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

#173 in Value formatting

Download history 342/week @ 2023-11-07 311/week @ 2023-11-14 341/week @ 2023-11-21 362/week @ 2023-11-28 420/week @ 2023-12-05 597/week @ 2023-12-12 331/week @ 2023-12-19 225/week @ 2023-12-26 307/week @ 2024-01-02 339/week @ 2024-01-09 395/week @ 2024-01-16 322/week @ 2024-01-23 503/week @ 2024-01-30 367/week @ 2024-02-06 352/week @ 2024-02-13 644/week @ 2024-02-20

1,933 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.1–3MB
~53K SLoC