Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
All notable changes to this project will be documented here.

## [unreleased]
- Update python tester to allow a requirements file (#580)

## [v2.6.0]
- Update python versions in docker file (#568)
Expand Down
4 changes: 4 additions & 0 deletions server/autotest_server/testers/py/settings_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
"pip_requirements": {
"title": "Package requirements",
"type": "string"
},
"pip_requirements_file": {
"title": "Package requirements file",
"type": "string"
}
}
},
Expand Down
6 changes: 5 additions & 1 deletion server/autotest_server/testers/py/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ def create_environment(settings_, env_dir, _default_env_dir):
requirements = os.path.join(os.path.dirname(os.path.realpath(__file__)), "requirements.txt")
pip = os.path.join(env_dir, "bin", "pip")
subprocess.run([f"python{python_version}", "-m", "venv", "--clear", env_dir], check=True)
subprocess.run([pip, "install", "-r", requirements, *pip_requirements], check=True)
pip_install_command = [pip, "install", "-r", requirements, *pip_requirements]
if env_data.get("pip_requirements_file"):
pip_install_command.append("-r")
pip_install_command.append(os.path.join(env_dir, "../", "files", env_data.get("pip_requirements_file")))
subprocess.run(pip_install_command, check=True)
return {"PYTHON": os.path.join(env_dir, "bin", "python3")}


Expand Down