https://github.com/moreati/ansible-uv
Ansible bindings for uv pip, by Astral.sh
https://github.com/moreati/ansible-uv
ansible ansible-collection
Last synced: 6 months ago
JSON representation
Ansible bindings for uv pip, by Astral.sh
- Host: GitHub
- URL: https://github.com/moreati/ansible-uv
- Owner: moreati
- Created: 2024-11-03T22:48:08.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-01-02T11:45:22.000Z (10 months ago)
- Last Synced: 2025-04-23T03:08:25.453Z (6 months ago)
- Topics: ansible, ansible-collection
- Language: Python
- Homepage: https://galaxy.ansible.com/ui/repo/published/moreati/uv/
- Size: 23.4 KB
- Stars: 13
- Watchers: 2
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ansible Collection - moreati.uv
A module for managing Python packages and virtualenvs using Astral's [uv].
The module is adapted from on Ansible's builtin [ansible.builtin.pip], so it
can be used as a drop in replacement.[ansible.builtin.pip]: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/pip_module.html
[uv]: https://docs.astral.sh/uv/## Example
```yaml
- name: Demonstrate moreati.uv
hosts: localhost
gather_facts: false
tasks:
- name: Install requests to a virtualenv
moreati.uv.pip:
name: requests
virtualenv: ~/venv
``````console
$ ansible-playbook playbook.yml -v
PLAY [Demonstrate moreati.uv] **************************************************TASK [Install requests to a virtualenv] ****************************************
changed: [localhost] => changed=true
cmd:
- /Users/alex/.cargo/bin/uv
- pip
- install
- --python
- /Users/alex/venv/bin/python
- requests
name:
- requests
requirements: null
state: present
stderr: |-
Using CPython 3.13.0 interpreter at: /Users/alex/.local/share/uv/tools/ansible-core/bin/python
Creating virtual environment at: /Users/alex/venv
Activate with: source /Users/alex/venv/bin/activate
Using Python 3.13.0 environment at /Users/alex/venv
Resolved 5 packages in 44ms
Installed 5 packages in 5ms
+ certifi==2024.8.30
+ charset-normalizer==3.4.0
+ idna==3.10
+ requests==2.32.3
+ urllib3==2.2.3
stderr_lines:
stdout: ''
stdout_lines:
version: null
virtualenv: /Users/alex/venvPLAY RECAP *********************************************************************
localhost : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0$ ~/venv/bin/python -c "import requests; print(requests.get('https://httpbin.org/get'))"
```