Skip to content

Commit

Permalink
Revert "Avoid package installs at every compilation"
Browse files Browse the repository at this point in the history
This reverts commit 79259bc.
  • Loading branch information
anubrag committed Jan 15, 2024
1 parent b5f788e commit 5253619
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 31 deletions.
48 changes: 19 additions & 29 deletions nextpy/build/prerequisites.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,39 +617,29 @@ def install_frontend_packages(packages: set[str]):
>>> install_frontend_packages(["react", "react-dom"])
"""
# Install the base packages.
# process = processes.new_process(
# [get_install_package_manager(), "install", "--loglevel", "silly"],
# cwd=constants.Dirs.WEB,
# shell=constants.IS_WINDOWS,
# )

# processes.show_status("Installing base frontend packages", process)
if not hasattr(install_frontend_packages, "isFirstRun"):
setattr(install_frontend_packages, "isFirstRun", None)
## Install the base packages.
process = processes.new_process(
[get_install_package_manager(), "install", "--loglevel", "silly"],
cwd=constants.Dirs.WEB,
shell=constants.IS_WINDOWS,
)

processes.show_status("Installing base frontend packages", process)

config = get_config()
if config.tailwind is not None:
# install tailwind and tailwind plugins as dev dependencies.
process = processes.new_process(
[get_install_package_manager(), "install", "--loglevel", "silly"],
[
get_install_package_manager(),
"add",
"-d",
constants.Tailwind.VERSION,
*((config.tailwind or {}).get("plugins", [])),
],
cwd=constants.Dirs.WEB,
shell=constants.IS_WINDOWS,
)

processes.show_status("Installing base frontend packages", process)

config = get_config()
if config.tailwind is not None:
# install tailwind and tailwind plugins as dev dependencies.
process = processes.new_process(
[
get_install_package_manager(),
"add",
"-d",
constants.Tailwind.VERSION,
*((config.tailwind or {}).get("plugins", [])),
],
cwd=constants.Dirs.WEB,
shell=constants.IS_WINDOWS,
)
processes.show_status("Installing tailwind", process)
processes.show_status("Installing tailwind", process)

# Install custom packages defined in frontend_packages
if len(packages) > 0:
Expand Down
2 changes: 0 additions & 2 deletions nextpy/build/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,6 @@ def stream_logs(message: str, process: subprocess.Popen, progress=None):
console.debug(message, progress=progress)
if process.stdout is None:
return
if process.stdout.closed :
return
for line in process.stdout:
console.debug(line, end="", progress=progress)
logs.append(line)
Expand Down

0 comments on commit 5253619

Please sign in to comment.