(project_folder_path, pip_reqs)
| 456 | json.dump(existing_state, f) |
| 457 | |
| 458 | def install_pip_reqs(project_folder_path, pip_reqs): |
| 459 | if not pip_reqs: |
| 460 | return |
| 461 | print("Installing pip requirements...") |
| 462 | with open(os.path.join(project_folder_path, "requirements.txt"), "w") as f: |
| 463 | for req in pip_reqs: |
| 464 | if isinstance(req, str): |
| 465 | f.write(req + "\n") |
| 466 | elif isinstance(req, dict): |
| 467 | f.write(f"{req['_key']}=={req['_version']}\n") |
| 468 | run_command_in_project_venv( |
| 469 | project_folder_path, |
| 470 | f"pip install -r {os.path.join(project_folder_path, 'requirements.txt')}", |
| 471 | ) |
| 472 | |
| 473 | def get_project_port(id): |
| 474 | project_path = os.path.join(PROJECTS_DIR, id) |
no test coverage detected