File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -725,13 +725,26 @@ def pip(
725725 def pip_install_local (
726726 self ,
727727 * args : StrPath ,
728+ find_links : StrPath | list [StrPath ] = pathlib .Path (DATA_DIR , "packages" ),
728729 ** kwargs : Any ,
729730 ) -> TestPipResult :
731+ """Invoke pip install without PyPI access. By default, only local
732+ packages are included via --find-links."""
733+ # Convert find links paths to absolute file: URIs
734+ if not isinstance (find_links , list ):
735+ find_links = [find_links ]
736+ find_links_args : list [StrPath ] = []
737+ for folder in find_links :
738+ if isinstance (folder , str ) and folder .startswith ("file:" ):
739+ find_links_args .extend (("--find-links" , folder ))
740+ else :
741+ path = pathlib .Path (folder ).resolve ()
742+ find_links_args .extend (("--find-links" , path .as_uri ()))
743+
730744 return self .pip (
731745 "install" ,
732746 "--no-index" ,
733- "--find-links" ,
734- pathlib .Path (DATA_DIR , "packages" ).as_uri (),
747+ * find_links_args ,
735748 * args ,
736749 ** kwargs ,
737750 )
You can’t perform that action at this time.
0 commit comments