MCPcopy Create free account
hub / github.com/conda/constructor / check_version

Function check_version

constructor/utils.py:371–388  ·  view source on GitHub ↗

Check if a version is within a version range. The minimum version is assumed to be inclusive, the maximum version is not inclusive.

(
    exe_version: str | VersionOrder | None = None,
    min_version: str | None = None,
    max_version: str | None = None,
)

Source from the content-addressed store, hash-verified

369
370
371def check_version(
372 exe_version: str | VersionOrder | None = None,
373 min_version: str | None = None,
374 max_version: str | None = None,
375) -> bool:
376 """Check if a version is within a version range.
377
378 The minimum version is assumed to be inclusive, the maximum version is not inclusive.
379 """
380 if not exe_version:
381 return False
382 if isinstance(exe_version, str):
383 exe_version = VersionOrder(exe_version)
384 if min_version and exe_version < VersionOrder(min_version):
385 return False
386 if max_version and exe_version >= VersionOrder(max_version):
387 return False
388 return True
389
390
391def win_str_esc(s, newlines=True):

Callers 3

_build_init_run_blockFunction · 0.85
validate_frozen_envsFunction · 0.85
main_buildFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected