File tree Expand file tree Collapse file tree 5 files changed +7
-7
lines changed Expand file tree Collapse file tree 5 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ def _conda_sel(sel: str) -> CondaPlatform:
5252 """Return the allowed `sel(platform)` string."""
5353 _platform = sel .split ("-" , 1 )[0 ]
5454 assert _platform in get_args (CondaPlatform ), f"Invalid platform: { _platform } "
55- return cast (CondaPlatform , _platform )
55+ return cast (" CondaPlatform" , _platform )
5656
5757
5858def _extract_conda_pip_dependencies (
@@ -196,7 +196,7 @@ def create_conda_env_specification( # noqa: PLR0912
196196 # other with [win].
197197 for _platform in _platforms :
198198 pip_deps .append (dep_str )
199- _add_comment (pip_deps , cast (Platform , _platform ))
199+ _add_comment (pip_deps , cast (" Platform" , _platform ))
200200 else :
201201 pip_deps .append (dep_str )
202202
Original file line number Diff line number Diff line change @@ -363,7 +363,7 @@ def _conda_lock_subpackage(
363363 yaml .representer .ignore_aliases = lambda * _ : True # Disable anchors
364364 conda_lock_output = file .parent / "conda-lock.yml"
365365 metadata = {
366- "content_hash" : { p : "unidep-is-awesome" for p in platforms } ,
366+ "content_hash" : dict . fromkeys ( platforms , "unidep-is-awesome" ) ,
367367 "channels" : [{"url" : c , "used_env_vars" : []} for c in channels ],
368368 "platforms" : platforms ,
369369 "sources" : [str (file )],
Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ class SetupVisitor(ast.NodeVisitor):
208208 def __init__ (self ) -> None :
209209 self .package_name = None
210210
211- def visit_Call (self , node : ast .Call ) -> None : # noqa: N802
211+ def visit_Call (self , node : ast .Call ) -> None :
212212 if isinstance (node .func , ast .Name ) and node .func .id == "setup" :
213213 for keyword in node .keywords :
214214 if keyword .arg == "name" :
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ def platforms_from_selector(selector: str) -> list[Platform]:
106106 # https://github.com/conda/conda-lock/blob/3d2bf356e2cf3f7284407423f7032189677ba9be/conda_lock/src_parser/selectors.py
107107 platforms : set [Platform ] = set ()
108108 for s in selector .split ():
109- s = cast (Selector , s )
109+ s = cast (" Selector" , s )
110110 platforms |= set (PLATFORM_SELECTOR_MAP_REVERSE [s ])
111111 return sorted (platforms )
112112
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ def parse_package_str(package_str: str) -> ParsedPackageStr:
166166
167167 if selector is not None :
168168 for s in selector .split ():
169- validate_selector (cast (Selector , s ))
169+ validate_selector (cast (" Selector" , s ))
170170
171171 return ParsedPackageStr (
172172 package_name ,
@@ -222,7 +222,7 @@ def selector_from_comment(comment: str) -> str | None:
222222 return None
223223 selectors = m .group (1 ).strip ().split ()
224224 for s in selectors :
225- validate_selector (cast (Selector , s ))
225+ validate_selector (cast (" Selector" , s ))
226226 return " " .join (selectors )
227227
228228
You can’t perform that action at this time.
0 commit comments