diff --git a/pynecone/constants.py b/pynecone/constants.py index 3161b847d..5c1cdc864 100644 --- a/pynecone/constants.py +++ b/pynecone/constants.py @@ -18,9 +18,9 @@ VERSION = pkg_resources.get_distribution(PACKAGE_NAME).version MIN_NODE_VERSION = "12.22.0" # Valid bun versions. -MIN_BUN_VERSION = "0.5.5" +MIN_BUN_VERSION = "0.5.8" MAX_BUN_VERSION = "0.5.9" -INVALID_BUN_VERSIONS = ["0.5.6", "0.5.7"] +INVALID_BUN_VERSIONS = ["0.5.5", "0.5.6", "0.5.7"] # Files and directories used to init a new project. # The root directory of the pynecone library. diff --git a/pynecone/utils/prerequisites.py b/pynecone/utils/prerequisites.py index 9b990ee7c..77772093a 100644 --- a/pynecone/utils/prerequisites.py +++ b/pynecone/utils/prerequisites.py @@ -211,19 +211,27 @@ def install_bun(): """Install bun onto the user's system. Raises: + Exit: If the bun version is not supported. FileNotFoundError: If the required packages are not installed. """ bun_version = get_bun_version() if bun_version is not None and bun_version in constants.INVALID_BUN_VERSIONS: console.print( - f"[red]Bun version {bun_version} is not supported by Pynecone. Please downgrade to bun version {constants.MIN_BUN_VERSION} or upgrade to {constants.MAX_BUN_VERSION} or higher." + f"""[red]Bun version {bun_version} is not supported by Pynecone. Please change your to bun version to be between {constants.MIN_BUN_VERSION} and {constants.MAX_BUN_VERSION}.""" ) - return + console.print( + f"""[red]Upgrade by running the following command:[/red] + +curl -fsSL https://bun.sh/install | bash -s -- bun-v{constants.MAX_BUN_VERSION} + +""" + ) + raise typer.Exit() # Bun is not supported on Windows. if platform.system() == "Windows": console.log("Skipping bun installation on Windows.") - return + raise typer.Exit() # Only install if bun is not already installed. if not os.path.exists(get_package_manager()): diff --git a/pyproject.toml b/pyproject.toml index ceb0afb3f..7bf1aa7f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pynecone" -version = "0.1.23" +version = "0.1.26" description = "Web apps in pure Python." license = "Apache-2.0" authors = [