aboutsummaryrefslogtreecommitdiff
path: root/ldcg-python-manylinux-tensorflow/ansible/roles/python/tasks/virtualenv.yml
blob: 819885cb2def29d53a426dcedb47f6257deb4749 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
- name: Set virtualenv path
  ansible.builtin.set_fact:
    virtualenv_path: "{{ build_dir }}/venv-{{ py_ver }}"

- name: Create virtualenv directory
  ansible.builtin.file:
    path: "{{ virtualenv_path }}"
    state: directory
    owner: buildslave
    group: buildslave
    mode: 0755

- name: Create Python {{ py_ver }} virtualenv
  become: true
  become_user: "buildslave"
  become_method: su
  ansible.builtin.pip:
    virtualenv: "{{ virtualenv_path }}"
    virtualenv_command: "/opt/python/{{ py_ver }}/bin/python3 -mvenv"
    extra_args: "--extra-index-url {{ pip_extra_index_url }} -c '{{ wheels_dir }}/upper-constraints.txt'"
    name:
      - pip
      - pkgconfig
      - Cython
      - wheel