|
| 1 | +# Ansible role: Python developer |
| 2 | + |
| 3 | +[][tests] |
| 4 | + |
| 5 | +[tests]: https://github.com/staticdev/ansible-role-python-developer/actions?workflow=Tests |
| 6 | + |
| 7 | +Ansible role to install packages for developing in Python using [Cookiecutter Hypermodern Python]. |
| 8 | + |
| 9 | +## Features |
| 10 | + |
| 11 | +Installs: |
| 12 | + |
| 13 | +- [Cookiecutter] |
| 14 | +- [Nox] |
| 15 | +- [Pipx] |
| 16 | +- [Poetry] |
| 17 | +- [pre-commit] |
| 18 | +- [pyenv] |
| 19 | + |
| 20 | +Note: for a playbook that installs IDEs, try [Linux workstation playbook]. |
| 21 | + |
| 22 | +## Requirements |
| 23 | + |
| 24 | +None. |
| 25 | + |
| 26 | +## Role Variables |
| 27 | + |
| 28 | +Here is the list of all variables and their default values: |
| 29 | + |
| 30 | +- `pyenv_global`: optional list of Python global versions for pyenv (from [staticdev.pyenv]) |
| 31 | +- `pyenv_python_versions`: optional list of Python versions installed (from [staticdev.pyenv]) |
| 32 | + |
| 33 | +## Dependencies |
| 34 | + |
| 35 | +- [staticdev.pyenv] |
| 36 | + |
| 37 | +## Example Playbook |
| 38 | + |
| 39 | +Here are some common usages of this role. |
| 40 | + |
| 41 | +1. Role using defaults: |
| 42 | + |
| 43 | +```yaml |
| 44 | +- hosts: all |
| 45 | + roles: |
| 46 | + - role: staticdev.python-developer |
| 47 | +``` |
| 48 | +
|
| 49 | +2. Role defining Python versions: |
| 50 | +
|
| 51 | +```yaml |
| 52 | +- hosts: all |
| 53 | + roles: |
| 54 | + - role: staticdev.python-developer |
| 55 | + vars: |
| 56 | + pyenv_global: |
| 57 | + - "3.11.0" |
| 58 | + pyenv_python_versions: |
| 59 | + - "3.11.0" |
| 60 | + - "3.10.6" |
| 61 | +``` |
| 62 | +
|
| 63 | +## License |
| 64 | +
|
| 65 | +Distributed under the terms of the [MIT] license, |
| 66 | +_Ansible role Python developer_ is free and open source software. |
| 67 | +
|
| 68 | +## Author Information |
| 69 | +
|
| 70 | +[staticdev] |
| 71 | +
|
| 72 | +[cookiecutter]: https://github.com/audreyr/cookiecutter |
| 73 | +[cookiecutter hypermodern python]: https://github.com/cjolowicz/cookiecutter-hypermodern-python |
| 74 | +[linux workstation playbook]: https://github.com/staticdev/linux-workstation-playbook |
| 75 | +[mit]: https://opensource.org/licenses/MIT |
| 76 | +[nox]: https://nox.thea.codes/ |
| 77 | +[pipx]: https://pypa.github.io/pipx/ |
| 78 | +[poetry]: https://python-poetry.org/ |
| 79 | +[pre-commit]: https://pre-commit.com/ |
| 80 | +[pyenv]: https://github.com/pyenv/pyenv |
| 81 | +[staticdev]: https://github.com/staticdev |
| 82 | +[staticdev.pyenv]: https://galaxy.ansible.com/staticdev/pyenv |
0 commit comments