@@ -552,24 +552,27 @@ public static void createVenv(Path venvDirectory, List<String> packages, Path lo
552552
553553 static boolean installPackagesFromReqFile (Path venvDirectory , Launcher launcher , String graalPyVersion ,
554554 BuildToolLog log , Path lockFilePath , Path reqFile ) throws IOException {
555- if (reqFile != null && Files .exists (reqFile )) {
556- log .info ("Using <requirements.txt> dependency mode." );
557- log .info ("Installing Python dependencies from: " + reqFile );
555+ if (reqFile == null ) {
556+ return false ;
557+ }
558+ if (!Files .exists (reqFile )) {
559+ return false ;
560+ }
561+ log .info ("Using <requirements.txt> dependency mode." );
562+ log .info ("Installing Python dependencies from: " + reqFile );
558563
559- warnIfLockFileExists (lockFilePath , log );
564+ warnIfLockFileExists (lockFilePath , log );
560565
561- VenvContents vc = ensureVenv (venvDirectory , graalPyVersion , launcher , log );
566+ VenvContents vc = ensureVenv (venvDirectory , graalPyVersion , launcher , log );
562567
563- runPip (venvDirectory , "install" , log , "--compile" , "-r" , reqFile .toString ());
564- List <String > reqPackages = requirementsPackages (reqFile );
565- vc .write (reqPackages );
568+ runPip (venvDirectory , "install" , log , "--compile" , "-r" , reqFile .toString ());
569+ List <String > reqPackages = requirementsPackages (reqFile );
570+ vc .write (reqPackages );
566571
567- InstalledPackages installed = InstalledPackages .fromVenv (venvDirectory );
568- installed .freeze (log );
572+ InstalledPackages installed = InstalledPackages .fromVenv (venvDirectory );
573+ installed .freeze (log );
569574
570- return true ;
571- }
572- return false ;
575+ return true ;
573576 }
574577
575578 private static void warnIfLockFileExists (Path lockFilePath , BuildToolLog log ) {
@@ -591,7 +594,7 @@ static void installPackages(Path venvDirectory, List<String> packages, Path lock
591594
592595 List <String > pluginPackages = trim (packages );
593596
594- LockFile lockFile = null ;
597+ VFSUtils . LockFile lockFile = null ;
595598 if (lockFilePath != null && Files .exists (lockFilePath )) {
596599 log .info ("Lock-file detected: " + lockFilePath );
597600 lockFile = LockFile .fromFile (lockFilePath , log );
0 commit comments