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(
725
725
def pip_install_local (
726
726
self ,
727
727
* args : StrPath ,
728
+ find_links : StrPath | list [StrPath ] = pathlib .Path (DATA_DIR , "packages" ),
728
729
** kwargs : Any ,
729
730
) -> 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
+
730
744
return self .pip (
731
745
"install" ,
732
746
"--no-index" ,
733
- "--find-links" ,
734
- pathlib .Path (DATA_DIR , "packages" ).as_uri (),
747
+ * find_links_args ,
735
748
* args ,
736
749
** kwargs ,
737
750
)
You can’t perform that action at this time.
0 commit comments