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
591 downloads per month
Used in 2 crates
45KB
498 lines
pep440
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