Pure MoonBit parser, normalizer, comparator and filter for PEP 440 Python versions and version specifiers.
import {
"123123213weqw/moon_pyversion" @pyversion,
}///|
fn main {
let v = try! @pyversion.Version::parse("v01.002-rc3+ABC_007")
println(@pyversion.Version::to_string(v))
let spec = try! @pyversion.SpecifierSet::parse(">=1.0, !=1.4.*, <2.0")
let accepted = @pyversion.SpecifierSet::filter(
[try! @pyversion.Version::parse("1.5")],
spec,
)
println(accepted.length())
}pub(all) struct Specifier {
op : SpecifierOp
raw_version : String
version : Version?
wildcard : Bool
} derive(Debug)fn SpecifierSet::filter(versions : Array[Version], spec : SpecifierSet, prereleases? : Bool?) -> Array[Version]Install
Download zipPure MoonBit parser, normalizer, comparator and filter for PEP 440 Python versions and version specifiers.