Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide warning for local installs where yarn is not present #2801

Merged
merged 2 commits into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion pre_build.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import os
import subprocess
from shutil import which
from sys import exit


def build() -> None:
if os.environ.get("SKIP_PRE_BUILD", "") == "true":
print("Skipping front end build...")
return
if which("yarn") is None:
print(
"Locust requires the yarn binary to be available in this shell to build the web front-end.\nSee: https://docs.locust.io/en/stable/developing-locust.html#making-changes-to-locust-s-web-ui"
)
exit(1)
print("Building front end...")
subprocess.run(["make", "frontend_build"])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for changing this? The make would run those two yarn commands right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It removes the dependency on make. Helps with some issues experienced here #2794

subprocess.run(["yarn", "webui:install"])
subprocess.run(["yarn", "webui:build"])


if __name__ == "__main__":
Expand Down
Loading