mirror of
https://github.com/hwchase17/langchain
synced 2024-11-13 19:10:52 +00:00
parse version specifiers of the form ^x in min version checks
This commit is contained in:
parent
09c3f787dd
commit
43b82f53cc
5
.github/scripts/get_min_versions.py
vendored
5
.github/scripts/get_min_versions.py
vendored
@ -78,6 +78,11 @@ def get_minimum_version(package_name: str, spec_string: str) -> Optional[str]:
|
||||
spec_string = re.sub(
|
||||
rf"\^{x}\.(\d+)\.(\d+)", rf">={x}.\1.\2,<{x+1}", spec_string
|
||||
)
|
||||
# Rewrite occurrences of ^x to >=x.0.0,<x+1.0.0 (can be anywhere in constraint string)
|
||||
for x in range(1, 10):
|
||||
spec_string = re.sub(
|
||||
rf"\^{x}(?!\.\d)", rf">={x}.0.0,<{x+1}.0.0", spec_string
|
||||
)
|
||||
|
||||
spec_set = SpecifierSet(spec_string)
|
||||
all_versions = get_pypi_versions(package_name)
|
||||
|
Loading…
Reference in New Issue
Block a user