File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
python/private/pypi/dependency_resolver Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 2424
2525import click
2626import piptools .writer as piptools_writer
27+ from pip ._internal .exceptions import DistributionNotFound
28+ from pip ._vendor .resolvelib .resolvers import ResolutionImpossible
2729from piptools .scripts .compile import cli
2830
2931from python .runfiles import runfiles
@@ -203,6 +205,7 @@ def main(
203205 requirements_file_relative_path .write_text (content )
204206 else :
205207 print ("Checking " + requirements_file )
208+ sys .stdout .flush ()
206209 _run_pip_compile ()
207210 golden = open (_locate (bazel_runfiles , requirements_file )).readlines ()
208211 out = open (requirements_out ).readlines ()
@@ -225,6 +228,14 @@ def run_pip_compile(
225228) -> None :
226229 try :
227230 cli (args , standalone_mode = False )
231+ except DistributionNotFound as e :
232+ if isinstance (e .__cause__ , ResolutionImpossible ):
233+ # pip logs an informative error to stderr already
234+ # just render the error and exit
235+ print (e )
236+ sys .exit (1 )
237+ else :
238+ raise
228239 except SystemExit as e :
229240 if e .code == 0 :
230241 return # shouldn't happen, but just in case
You can’t perform that action at this time.
0 commit comments