Skip to content

Commit 1cb7db9

Browse files
committed
Update dependencies installation process
1 parent 91320ba commit 1cb7db9

File tree

2 files changed

+21
-55
lines changed

2 files changed

+21
-55
lines changed

hikka/__main__.py

Lines changed: 21 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@
2929
sys.exit(1)
3030

3131

32+
def deps():
33+
subprocess.run(
34+
[
35+
sys.executable,
36+
"-m",
37+
"pip",
38+
"install",
39+
"--upgrade",
40+
"-q",
41+
"--disable-pip-version-check",
42+
"--no-warn-script-location",
43+
"-r",
44+
"requirements.txt",
45+
],
46+
check=True,
47+
)
48+
49+
3250
if sys.version_info < (3, 8, 0):
3351
print("🚫 Error: you must use at least Python version 3.8.0")
3452
elif __package__ != "hikka": # In case they did python __main__.py
@@ -44,49 +62,14 @@
4462

4563
if tuple(map(int, hikkatl.__version__.split("."))) < (2, 0, 2):
4664
raise ImportError
47-
except ImportError:
48-
print("🔄 Installing Hikka-TL...")
49-
50-
subprocess.run(
51-
[
52-
sys.executable,
53-
"-m",
54-
"pip",
55-
"install",
56-
"--force-reinstall",
57-
"-q",
58-
"--disable-pip-version-check",
59-
"--no-warn-script-location",
60-
"hikka-tl-new",
61-
],
62-
check=True,
63-
)
64-
65-
restart()
6665

67-
try:
6866
import hikkapyro
6967

7068
if tuple(map(int, hikkapyro.__version__.split("."))) < (2, 0, 102):
7169
raise ImportError
7270
except ImportError:
73-
print("🔄 Installing Hikka-Pyro...")
74-
75-
subprocess.run(
76-
[
77-
sys.executable,
78-
"-m",
79-
"pip",
80-
"install",
81-
"--force-reinstall",
82-
"-q",
83-
"--disable-pip-version-check",
84-
"--no-warn-script-location",
85-
"hikka-pyro-new",
86-
],
87-
check=True,
88-
)
89-
71+
print("🔄 Installing dependencies...")
72+
deps()
9073
restart()
9174

9275
try:
@@ -97,23 +80,7 @@
9780
from . import main
9881
except ImportError as e:
9982
print(f"{str(e)}\n🔄 Attempting dependencies installation... Just wait ⏱")
100-
101-
subprocess.run(
102-
[
103-
sys.executable,
104-
"-m",
105-
"pip",
106-
"install",
107-
"--upgrade",
108-
"-q",
109-
"--disable-pip-version-check",
110-
"--no-warn-script-location",
111-
"-r",
112-
"requirements.txt",
113-
],
114-
check=True,
115-
)
116-
83+
deps()
11784
restart()
11885

11986
if "HIKKA_DO_NOT_RESTART" in os.environ:

hikka/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ def generate_app_name() -> str:
137137
:return: Random app name
138138
:example: "Cresco Cibus Consilium"
139139
"""
140-
random.seed(0)
141140
return " ".join(random.choices(LATIN_MOCK, k=3))
142141

143142

0 commit comments

Comments
 (0)