-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall.py
More file actions
64 lines (54 loc) · 2.01 KB
/
install.py
File metadata and controls
64 lines (54 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import os
import sys
import platform
import subprocess
from rich.console import Console
from rich.panel import Panel
from rich.text import Text
console = Console()
# Define all common packages
REQUIREMENTS = [
"rich>=13.5.2",
"web3>=6.12.0",
"tronpy>=0.4.0",
"eth-account>=0.9.0",
"requests>=2.31.0",
"bitcoinlib>=0.6.14",
"rgbprint~=4.0.2",
"qrcode~=8.2",
"base58~=2.1.1",
"pycoin~=0.92.20241201",
"pynacl"
]
MONERO_PKG = "monero"
def install_package(package, allow_broken=False):
try:
args = [sys.executable, "-m", "pip", "install", package]
if allow_broken:
args += ["--break-system-packages"]
subprocess.check_call(args)
console.print(f"[green]✔ Installed:[/green] [bold]{package}[/bold]")
except subprocess.CalledProcessError as e:
if not allow_broken:
console.print(f"[yellow]⚠ Retrying with --break-system-packages for:[/yellow] [bold]{package}[/bold]")
install_package(package, allow_broken=True)
else:
console.print(f"[red]✘ Failed to install:[/red] [bold]{package}[/bold]")
console.print(f"[dim]Error: {e}[/dim]")
def main():
console.print(Panel.fit("🚀 [bold cyan]Starting Dependency Installation[/bold cyan]"))
for pkg in REQUIREMENTS:
install_package(pkg)
if platform.system().lower() == "linux":
console.print("\n[bold magenta]🔧 Linux detected! Attempting to install monero...[/bold magenta]")
install_package(MONERO_PKG)
else:
console.print(Panel.fit(
"❌ Skipping 'monero' installation.\n[bold yellow]This library is Linux-only.[/bold yellow]",
title="⚠️ Notice", border_style="red", padding=(1, 2)
))
console.print(Panel.fit(
"[bold green]🎉 All done! You're ready to run the wallet CLI suite.[/bold green]",
title="✅ Success", border_style="green"))
if __name__ == "__main__":
main()