Skip to content

Commit 5d10181

Browse files
addressed the PR feedback
1 parent 3b29751 commit 5d10181

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/lightning_app/runners/cloud.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def dispatch(
236236
f.write("venv/\n")
237237
if (root / "bin" / "activate").is_file() or (root / "pyvenv.cfg").is_file():
238238
# the user is developing inside venv
239-
f.write("bin/\n" "include/\n" "lib/\n" "pyvenv.cfg\n")
239+
f.write("bin/\ninclude/\nlib/\npyvenv.cfg\n")
240240

241241
repo = LocalSourceCodeDir(path=root, ignore_functions=ignore_functions)
242242
self._check_uploaded_folder(root, repo)
@@ -565,7 +565,8 @@ def _check_uploaded_folder(root: Path, repo: LocalSourceCodeDir) -> None:
565565
f"The total size is {round(app_folder_size_in_mb, 2)} MB. {len(files)} files were uploaded.\n"
566566
+ largest_paths_msg
567567
+ "Perhaps you should try running the app in an empty directory.\n"
568-
"You can ignore some files or folders by adding them to `.lightningignore`."
568+
+ "You can ignore some files or folders by adding them to `.lightningignore`.\n"
569+
+ " You can also set the `self.lightningingore` attribute in a Flow or Work."
569570
)
570571

571572
logger.warn(warning_msg)

tests/tests_app/runners/test_cloud.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,7 @@ def test_check_uploaded_folder(monkeypatch, tmpdir, caplog):
13351335
assert "3 files were uploaded" in caplog.text
13361336
assert "files:\n6.0 MB: c.jpg\n5.0 MB: b.txt\n4.0 MB: a.png\nPerhaps" in caplog.text # tests the order
13371337
assert "adding them to `.lightningignore`." in caplog.text
1338+
assert "lightningingore` attribute in a Flow or Work" in caplog.text
13381339

13391340

13401341
@mock.patch("lightning_app.core.queues.QueuingSystem", MagicMock())
@@ -1598,6 +1599,8 @@ def run(self):
15981599
write_file_of_size(path / "a.txt", 5 * 1000 * 1000)
15991600
write_file_of_size(path / "venv" / "foo.txt", 4 * 1000 * 1000)
16001601

1602+
assert not (path / ".lightningignore").exists()
1603+
16011604
with mock.patch(
16021605
"lightning_app.runners.cloud._parse_lightningignore", wraps=_parse_lightningignore
16031606
) as parse_mock, mock.patch(

0 commit comments

Comments
 (0)