7
7
from pathlib import Path
8
8
import tomllib
9
9
10
+ from packaging .requirements import Requirement
11
+
10
12
from get_min_versions import get_min_version_from_toml
11
13
12
14
37
39
38
40
PY_312_MAX_PACKAGES = [
39
41
"libs/partners/huggingface" , # https://github.com/pytorch/pytorch/issues/130249
42
+ "libs/partners/pinecone" ,
43
+ "libs/partners/voyageai" ,
40
44
]
41
45
42
46
@@ -61,15 +65,17 @@ def dependents_graph() -> dict:
61
65
62
66
# load regular and test deps from pyproject.toml
63
67
with open (path , "rb" ) as f :
64
- pyproject = tomllib .load (f )[ "tool" ][ "poetry" ]
68
+ pyproject = tomllib .load (f )
65
69
66
70
pkg_dir = "libs" + "/" .join (path .split ("libs" )[1 ].split ("/" )[:- 1 ])
67
71
for dep in [
68
- * pyproject ["dependencies" ]. keys () ,
69
- * pyproject ["group " ]["test" ][ "dependencies" ]. keys () ,
72
+ * pyproject ["project" ][ " dependencies" ],
73
+ * pyproject ["dependency-groups " ]["test" ],
70
74
]:
75
+ requirement = Requirement (dep )
76
+ package_name = requirement .name
71
77
if "langchain" in dep :
72
- dependents [dep ].add (pkg_dir )
78
+ dependents [package_name ].add (pkg_dir )
73
79
continue
74
80
75
81
# load extended deps from extended_testing_deps.txt
@@ -120,8 +126,7 @@ def _get_configs_for_single_dir(job: str, dir_: str) -> List[Dict[str, str]]:
120
126
py_versions = ["3.9" , "3.10" , "3.11" , "3.12" , "3.13" ]
121
127
# custom logic for specific directories
122
128
elif dir_ == "libs/partners/milvus" :
123
- # milvus poetry doesn't allow 3.12 because they
124
- # declare deps in funny way
129
+ # milvus doesn't allow 3.12 because they declare deps in funny way
125
130
py_versions = ["3.9" , "3.11" ]
126
131
127
132
elif dir_ in PY_312_MAX_PACKAGES :
@@ -148,17 +153,17 @@ def _get_configs_for_single_dir(job: str, dir_: str) -> List[Dict[str, str]]:
148
153
def _get_pydantic_test_configs (
149
154
dir_ : str , * , python_version : str = "3.11"
150
155
) -> List [Dict [str , str ]]:
151
- with open ("./libs/core/poetry .lock" , "rb" ) as f :
152
- core_poetry_lock_data = tomllib .load (f )
153
- for package in core_poetry_lock_data ["package" ]:
156
+ with open ("./libs/core/uv .lock" , "rb" ) as f :
157
+ core_uv_lock_data = tomllib .load (f )
158
+ for package in core_uv_lock_data ["package" ]:
154
159
if package ["name" ] == "pydantic" :
155
160
core_max_pydantic_minor = package ["version" ].split ("." )[1 ]
156
161
break
157
162
158
- with open (f"./{ dir_ } /poetry .lock" , "rb" ) as f :
159
- dir_poetry_lock_data = tomllib .load (f )
163
+ with open (f"./{ dir_ } /uv .lock" , "rb" ) as f :
164
+ dir_uv_lock_data = tomllib .load (f )
160
165
161
- for package in dir_poetry_lock_data ["package" ]:
166
+ for package in dir_uv_lock_data ["package" ]:
162
167
if package ["name" ] == "pydantic" :
163
168
dir_max_pydantic_minor = package ["version" ].split ("." )[1 ]
164
169
break
@@ -304,7 +309,7 @@ def _get_configs_for_multi_dirs(
304
309
f"Unknown lib: { file } . check_diff.py likely needs "
305
310
"an update for this new library!"
306
311
)
307
- elif file .startswith ("docs/" ) or file in ["pyproject.toml" , "poetry .lock" ]: # docs or root poetry files
312
+ elif file .startswith ("docs/" ) or file in ["pyproject.toml" , "uv .lock" ]: # docs or root uv files
308
313
docs_edited = True
309
314
dirs_to_run ["lint" ].add ("." )
310
315
0 commit comments