Skip to content

Commit 0688b4c

Browse files
authored
Fix bun install (#796)
1 parent ae49759 commit 0688b4c

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

pynecone/utils/prerequisites.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,11 @@ def check_node_version(min_version):
4141
return False
4242

4343

44-
def get_bun_version() -> str:
44+
def get_bun_version() -> Optional[str]:
4545
"""Get the version of bun.
4646
4747
Returns:
4848
The version of bun.
49-
50-
Raises:
51-
FileNotFoundError: If bun is not installed.
5249
"""
5350
try:
5451
# Run the bun -v command and capture the output
@@ -58,7 +55,7 @@ def get_bun_version() -> str:
5855
version = result.stdout.decode().strip()
5956
return version
6057
except Exception:
61-
raise FileNotFoundError("Pynecone requires bun to be installed.") from None
58+
return None
6259

6360

6461
def get_package_manager() -> str:
@@ -214,9 +211,10 @@ def install_bun():
214211
Raises:
215212
FileNotFoundError: If the required packages are not installed.
216213
"""
217-
if get_bun_version() in constants.INVALID_BUN_VERSIONS:
214+
bun_version = get_bun_version()
215+
if bun_version is not None and bun_version in constants.INVALID_BUN_VERSIONS:
218216
console.print(
219-
f"[red]Bun version {get_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."
217+
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."
220218
)
221219
return
222220

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pynecone"
3-
version = "0.1.21"
3+
version = "0.1.22"
44
description = "Web apps in pure Python."
55
license = "Apache-2.0"
66
authors = [

0 commit comments

Comments
 (0)