Skip to content

Commit

Permalink
add automatic dependencies install for demonstrators
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr.malkowski authored and koalamitice committed Nov 4, 2024
1 parent c6e73b3 commit 91df948
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions scripts/install-python-dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
import subprocess

script_dir = os.path.dirname(os.path.realpath(__file__))
base_dir = os.path.join(script_dir, '..', 'solvers')

for root, dirs, files in os.walk(base_dir):
# Check if 'requirements.txt' is in the current directory
req_file = os.path.join(root, 'requirements.txt')
if os.path.exists(req_file):
print(f"Found requirements.txt in {root}, installing dependencies...")
try:
subprocess.run(['pip', 'install', '-r', req_file], check=True) # single thread to avoid dep. errors
except subprocess.CalledProcessError as e:
print(f"Error installing requirements for {root}: {e}")



base_dirs = [
os.path.join(script_dir, '..', 'solvers'),
os.path.join(script_dir, '..', 'demonstrators')
]

for base_dir in base_dirs:
for root, dirs, files in os.walk(base_dir):
# Check if 'requirements.txt' is in the current directory
req_file = os.path.join(root, 'requirements.txt')
if os.path.exists(req_file):
print(f"Found requirements.txt in {root}, installing dependencies...")
try:
subprocess.run(['pip', 'install', '-r', req_file], check=True) # single thread to avoid dep. errors
except subprocess.CalledProcessError as e:
print(f"Error installing requirements for {root}: {e}")

0 comments on commit 91df948

Please sign in to comment.