@@ -48,14 +48,15 @@ def install_packages_with_poetry():
4848 return python_executable_path
4949
5050
51- def install_packages_with_pipenv ():
51+ def install_packages_with_pipenv (has_lockfile ):
5252 command = [sys .executable , '-m' , 'pipenv' ]
5353 if sys .platform .startswith ('win32' ):
5454 # In windows the default path were the deps are installed gets wiped out between steps,
5555 # so we have to set it up to a folder that will be kept
5656 os .environ ['WORKON_HOME' ] = os .path .join (os .environ ['RUNNER_WORKSPACE' ], 'virtualenvs' )
57+ lock_args = ['--keep-outdated' , '--ignore-pipfile' ] if has_lockfile else ['--skip-lock' ]
5758 try :
58- _check_call (command + ['install' , '--keep-outdated' , '--ignore-pipfile' ] )
59+ _check_call (command + ['install' ] + lock_args )
5960 except subprocess .CalledProcessError :
6061 sys .exit ('package installation with pipenv failed, see error above' )
6162
@@ -145,9 +146,10 @@ def install_packages(codeql_base_dir) -> Optional[str]:
145146 if os .path .exists ('Pipfile' ) or os .path .exists ('Pipfile.lock' ):
146147 if os .path .exists ('Pipfile.lock' ):
147148 print ('Found Pipfile.lock, will install packages with Pipenv' , flush = True )
149+ return install_packages_with_pipenv (has_lockfile = True )
148150 else :
149151 print ('Found Pipfile, will install packages with Pipenv' , flush = True )
150- return install_packages_with_pipenv ()
152+ return install_packages_with_pipenv (has_lockfile = False )
151153
152154 # get_extractor_version returns the Python version the extractor thinks this repo is using
153155 version = extractor_version .get_extractor_version (codeql_base_dir , quiet = False )
0 commit comments