Fix local installer compatibility on newer hosts
Made-with: Cursor
This commit is contained in:
@@ -4,15 +4,58 @@
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Create Open WebUI virtual environment
|
||||
- name: Create uv helper virtual environment
|
||||
command:
|
||||
argv:
|
||||
- "{{ courseware_python_bin }}"
|
||||
- -m
|
||||
- venv
|
||||
- "{{ courseware_uv_venv_dir }}"
|
||||
args:
|
||||
creates: "{{ courseware_uv_venv_dir }}/bin/python"
|
||||
|
||||
- name: Install uv helper
|
||||
command:
|
||||
argv:
|
||||
- "{{ courseware_uv_venv_dir }}/bin/python"
|
||||
- -m
|
||||
- pip
|
||||
- install
|
||||
- --upgrade
|
||||
- pip
|
||||
- uv
|
||||
args:
|
||||
creates: "{{ courseware_uv_venv_dir }}/bin/uv"
|
||||
|
||||
- name: Check Open WebUI virtual environment Python version
|
||||
command:
|
||||
argv:
|
||||
- "{{ courseware_venvs_dir }}/open-webui/bin/python"
|
||||
- -c
|
||||
- "import importlib.util, sys; expected = tuple(map(int, '{{ courseware_open_webui_python_version }}'.split('.')[:2])); ok = sys.version_info[:len(expected)] == expected and importlib.util.find_spec('pip') is not None; raise SystemExit(0 if ok else 1)"
|
||||
register: courseware_open_webui_python_check
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: Remove incompatible Open WebUI virtual environment
|
||||
file:
|
||||
path: "{{ courseware_venvs_dir }}/open-webui"
|
||||
state: absent
|
||||
when: courseware_open_webui_python_check.rc != 0
|
||||
|
||||
- name: Create Open WebUI virtual environment
|
||||
command:
|
||||
argv:
|
||||
- "{{ courseware_uv_venv_dir }}/bin/uv"
|
||||
- venv
|
||||
- --seed
|
||||
- --python
|
||||
- "{{ courseware_open_webui_python_version }}"
|
||||
- "{{ courseware_venvs_dir }}/open-webui"
|
||||
args:
|
||||
creates: "{{ courseware_venvs_dir }}/open-webui/bin/python"
|
||||
environment:
|
||||
UV_PYTHON_INSTALL_DIR: "{{ courseware_uv_python_install_dir }}"
|
||||
|
||||
- name: Upgrade Open WebUI venv tooling
|
||||
command:
|
||||
|
||||
Reference in New Issue
Block a user