Bun Version update (#1216)

This commit is contained in:
Elijah Ahianyo 2023-06-19 21:49:36 +00:00 committed by GitHub
parent 5e41985bfe
commit e180f4d43a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 3 deletions

View File

@ -44,7 +44,7 @@ MIN_NODE_VERSION = "16.8.0"
# Valid bun versions. # Valid bun versions.
MIN_BUN_VERSION = "0.5.9" 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. # Files and directories used to init a new project.
# The root directory of the pynecone library. # The root directory of the pynecone library.

View File

@ -10,10 +10,23 @@ from pynecone import Env, constants
from pynecone.utils import build, format, imports, prerequisites, types from pynecone.utils import build, format, imports, prerequisites, types
from pynecone.vars import Var 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") V055 = version.parse("0.5.5")
V059 = version.parse("0.5.9") V059 = version.parse("0.5.9")
V056 = version.parse("0.5.6") V056 = version.parse("0.5.6")
V062 = version.parse("0.6.2") VMAXPLUS1 = version.parse(get_above_max_version())
@pytest.mark.parametrize( @pytest.mark.parametrize(
@ -245,7 +258,7 @@ def test_format_route(route: str, expected: bool):
[ [
(V055, False, "yes"), (V055, False, "yes"),
(V059, True, None), (V059, True, None),
(V062, False, "yes"), (VMAXPLUS1, False, "yes"),
], ],
) )
def test_bun_validate_and_install(mocker, bun_version, is_valid, prompt_input): def test_bun_validate_and_install(mocker, bun_version, is_valid, prompt_input):