Skip to content

Commit

Permalink
Require Python package version to be equal to the REPL one
Browse files Browse the repository at this point in the history
While we keep them in the same repo and version them synchronously it
works. Local version of the Python package doesn't intervene to the
check because PEP440 requires it to be compatible with a public version.
  • Loading branch information
vsbogd committed Jul 12, 2024
1 parent 6de40bc commit 61ee39b
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions repl/src/metta_shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,7 @@ pub mod metta_interface_mod {

fn required_hyperon_version() -> String {
const PACKAGE_VERSION: &str = env!("CARGO_PKG_VERSION");

fn comparator(op: semver::Op, ver: &semver::Version) -> semver::Comparator {
semver::Comparator{
op,
major: ver.major,
minor: Some(ver.minor),
patch: Some(0),
pre: semver::Prerelease::EMPTY,
}
}

let mut ver = semver::Version::parse(PACKAGE_VERSION).unwrap();
let lower_bound = comparator(semver::Op::GreaterEq, &ver);
ver.minor = ver.minor + 1;
let upper_bound = comparator(semver::Op::Less, &ver);
let req = semver::VersionReq{ comparators: vec![lower_bound, upper_bound] };
req.to_string()
format!("=={PACKAGE_VERSION}")
}

pub fn init_common_env(working_dir: PathBuf, include_paths: Vec<PathBuf>) -> Result<MettaShim, String> {
Expand Down

0 comments on commit 61ee39b

Please sign in to comment.