Skip to content

Commit

Permalink
convert_script_files does not require script to exist
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed Feb 16, 2024
1 parent 3ef8743 commit 7ea0526
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
10 changes: 0 additions & 10 deletions src/poetry/core/masonry/builders/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,16 +364,6 @@ def convert_script_files(self) -> list[Path]:

abs_path = Path.joinpath(self._path, source)

if not abs_path.exists():
raise RuntimeError(
f"{abs_path} in script specification ({name}) is not found."
)

if not abs_path.is_file():
raise RuntimeError(
f"{abs_path} in script specification ({name}) is not a file."
)

script_files.append(abs_path)

return script_files
Expand Down
13 changes: 0 additions & 13 deletions tests/masonry/builders/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,6 @@ def test_metadata_with_url_dependencies() -> None:
)


def test_missing_script_files_throws_error() -> None:
builder = Builder(
Factory().create_poetry(
Path(__file__).parent / "fixtures" / "script_reference_file_missing"
)
)

with pytest.raises(RuntimeError) as err:
builder.convert_script_files()

assert "is not found." in str(err.value)


def test_invalid_script_files_definition() -> None:
with pytest.raises(RuntimeError) as err:
Builder(
Expand Down

0 comments on commit 7ea0526

Please sign in to comment.