Spaces:
Running
Running
ZaaachX
commited on
Commit
·
75dd009
1
Parent(s):
0673cdf
bug fixed
Browse files
app.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
from git import Repo
|
2 |
import os
|
3 |
import subprocess
|
|
|
|
|
4 |
|
5 |
GITHUB_PAT = os.getenv('GITHUB_PAT')
|
6 |
GIT_USER = os.getenv('GIT_USER')
|
@@ -15,6 +17,7 @@ if not os.path.exists('cloned_repo'):
|
|
15 |
# Install Python dependencies
|
16 |
subprocess.run(['pip', 'install', '-r', 'cloned_repo/requirements.txt'])
|
17 |
|
|
|
18 |
# Install system-level dependencies if packages.txt exists
|
19 |
if os.path.exists('cloned_repo/packages.txt'):
|
20 |
with open('cloned_repo/packages.txt') as f:
|
@@ -23,5 +26,7 @@ if os.path.exists('cloned_repo/packages.txt'):
|
|
23 |
subprocess.run(['apt-get', 'update'])
|
24 |
subprocess.run(['apt-get', 'install', '-y'] + packages)
|
25 |
|
26 |
-
|
27 |
-
|
|
|
|
|
|
1 |
from git import Repo
|
2 |
import os
|
3 |
import subprocess
|
4 |
+
import sys
|
5 |
+
|
6 |
|
7 |
GITHUB_PAT = os.getenv('GITHUB_PAT')
|
8 |
GIT_USER = os.getenv('GIT_USER')
|
|
|
17 |
# Install Python dependencies
|
18 |
subprocess.run(['pip', 'install', '-r', 'cloned_repo/requirements.txt'])
|
19 |
|
20 |
+
|
21 |
# Install system-level dependencies if packages.txt exists
|
22 |
if os.path.exists('cloned_repo/packages.txt'):
|
23 |
with open('cloned_repo/packages.txt') as f:
|
|
|
26 |
subprocess.run(['apt-get', 'update'])
|
27 |
subprocess.run(['apt-get', 'install', '-y'] + packages)
|
28 |
|
29 |
+
sys.path.insert(0, os.path.abspath('cloned_repo'))
|
30 |
+
|
31 |
+
# Now you can import your modules correctly
|
32 |
+
import main
|