Skip to content

Commit

Permalink
more information in case of error (#7784)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby authored Apr 11, 2023
1 parent 7c9a565 commit 71754bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/poetry/inspection/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ def get_pep517_metadata(path: Path) -> PackageInfo:
info = PackageInfo.from_metadata(path)
except EnvCommandError as fbe:
raise PackageInfoError(
path, "Fallback egg_info generation failed.", fbe
path, e, "Fallback egg_info generation failed.", fbe
)
finally:
os.chdir(cwd)
Expand Down
8 changes: 2 additions & 6 deletions tests/inspection/test_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,8 @@ def test_info_setup_missing_mandatory_should_trigger_pep517(
setup_py.write_text(decode(setup))

spy = mocker.spy(VirtualEnv, "run")
try:
PackageInfo.from_directory(source_dir)
except PackageInfoError:
assert spy.call_count == 3
else:
assert spy.call_count == 1
_ = PackageInfo.from_directory(source_dir)
assert spy.call_count == 1


def test_info_prefer_poetry_config_over_egg_info():
Expand Down

0 comments on commit 71754bc

Please sign in to comment.