use-python-version 0.0.1

Python version and implementation primitives for RustUse
Documentation
  • Coverage
  • 67.44%
    29 out of 43 items documented1 out of 32 items with examples
  • Size
  • Source code size: 17.11 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.16 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 6s Average build duration of successful builds.
  • all releases: 6s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-python
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-python-version

Python version and implementation primitives for RustUse.

Experimental

use-python-version is experimental while use-python remains below 0.3.0.

Example

use use_python_version::{PythonImplementation, PythonVersion};

let version: PythonVersion = "Python 3.12.1".parse()?;

assert_eq!(version.major(), 3);
assert_eq!(version.minor(), Some(12));
assert!(version.is_python3());
assert_eq!(PythonImplementation::CPython.as_str(), "cpython");
# Ok::<(), use_python_version::PythonVersionParseError>(())

Scope

  • Lightweight Python version components and parsing.
  • Python implementation labels.
  • Compatibility, ABI, and platform tag text newtypes.

Non-goals

  • Full PEP 440 parsing.
  • Support-window or EOL-date policy.
  • Querying installed Python interpreters.

License

Licensed under either Apache-2.0 or MIT.