Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add pip.conf optional installation #117

Merged
merged 1 commit into from
Mar 23, 2024
Merged
Changes from all 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
18 changes: 18 additions & 0 deletions roles/python/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@
- python3-venv
- virtualenv

- name: Check if pip.conf file exists
ansible.builtin.stat:
path: "{{ remote_role_path }}/files/pip.conf"
register: python_pip_conf

- name: Create ~/.config/pip directory
ansible.builtin.file:
path: "{{ home }}/.config/pip"
state: directory
mode: "0o755"

- name: Create symlink to pip.conf
ansible.builtin.file:
src: "{{ remote_role_path }}/files/pip.conf"
dest: "{{ home }}/.config/pip/pip.conf"
state: link
when: python_pip_conf.stat.exists

# https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#where-black-looks-for-the-file
- name: Create symlink to global black config
ansible.builtin.file:
Expand Down
Loading