From e180f4d43a892a41baf1d518d2af877aa77ffb74 Mon Sep 17 00:00:00 2001 From: Elijah Ahianyo Date: Mon, 19 Jun 2023 21:49:36 +0000 Subject: [PATCH] Bun Version update (#1216) --- pynecone/constants.py | 2 +- tests/test_utils.py | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/pynecone/constants.py b/pynecone/constants.py index bf38acb39..33e4ee517 100644 --- a/pynecone/constants.py +++ b/pynecone/constants.py @@ -44,7 +44,7 @@ MIN_NODE_VERSION = "16.8.0" # Valid bun versions. MIN_BUN_VERSION = "0.5.9" -MAX_BUN_VERSION = "0.6.1" +MAX_BUN_VERSION = "0.6.9" # Files and directories used to init a new project. # The root directory of the pynecone library. diff --git a/tests/test_utils.py b/tests/test_utils.py index d5cb623f9..8f98f47c1 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -10,10 +10,23 @@ from pynecone import Env, constants from pynecone.utils import build, format, imports, prerequisites, types from pynecone.vars import Var + +def get_above_max_version(): + """Get the 1 version above the max required bun version. + + Returns: + max bun version plus one. + + """ + semantic_version_list = constants.MAX_BUN_VERSION.split(".") + semantic_version_list[-1] = str(int(semantic_version_list[-1]) + 1) # type: ignore + return ".".join(semantic_version_list) + + V055 = version.parse("0.5.5") V059 = version.parse("0.5.9") V056 = version.parse("0.5.6") -V062 = version.parse("0.6.2") +VMAXPLUS1 = version.parse(get_above_max_version()) @pytest.mark.parametrize( @@ -245,7 +258,7 @@ def test_format_route(route: str, expected: bool): [ (V055, False, "yes"), (V059, True, None), - (V062, False, "yes"), + (VMAXPLUS1, False, "yes"), ], ) def test_bun_validate_and_install(mocker, bun_version, is_valid, prompt_input):