|
| 1 | +Ansible role: Python developer |
| 2 | +============================== |
| 3 | + |
| 4 | +|Status| |Tests| |
| 5 | + |
| 6 | +.. |Status| image:: https://badgen.net/badge/status/beta/orange |
| 7 | + :target: https://badgen.net/badge/status/beta/orange |
| 8 | + :alt: Project Status |
| 9 | +.. |Tests| image:: https://github.com/staticdev/ansible-role-python-developer/workflows/Tests/badge.svg |
| 10 | + :target: https://github.com/staticdev/ansible-role-python-developer/actions?workflow=Tests |
| 11 | + :alt: Tests |
| 12 | + |
| 13 | +Ansible role to install packages for developing in Python using `Cookiecutter Hypermodern Python`_. |
| 14 | + |
| 15 | + |
| 16 | +Features |
| 17 | +-------- |
| 18 | + |
| 19 | +Installs: |
| 20 | + |
| 21 | +- pre-commit |
| 22 | +- pipx |
| 23 | +- nox |
| 24 | +- pyenv |
| 25 | +- poetry |
| 26 | +- cookiecutter |
| 27 | + |
| 28 | + |
| 29 | +Requirements |
| 30 | +------------ |
| 31 | + |
| 32 | +None. |
| 33 | + |
| 34 | + |
| 35 | +Role Variables |
| 36 | +-------------- |
| 37 | + |
| 38 | +Here is the list of all variables and their default values: |
| 39 | + |
| 40 | +- `install_pycharm`: `false` |
| 41 | +- `pycharm_flavor`: `community`. You can use also `professional` or `edu` |
| 42 | +- `pycharm_version`: `2021.1.2` |
| 43 | +- `install_vscode`: `false` |
| 44 | +- `vscode_extensions`: optional list of name_ids of extensions. eg.: ms-python.python (Python Official Extension) |
| 45 | +- `pyenv_global`: optional Python global version for pyenv (from `staticdev.pyenv`_) |
| 46 | +- `pyenv_python_versions`: optional list of Python versions installed (from `staticdev.pyenv`_) |
| 47 | + |
| 48 | + |
| 49 | +Dependencies |
| 50 | +------------ |
| 51 | + |
| 52 | +- `staticdev.pyenv`_ |
| 53 | +- `gantsign.visual-studio-code`_ (optional) |
| 54 | + |
| 55 | + |
| 56 | +Example Playbook |
| 57 | +---------------- |
| 58 | + |
| 59 | +.. code:: yaml |
| 60 | +
|
| 61 | + # role without IDE |
| 62 | + - hosts: all |
| 63 | + roles: |
| 64 | + - role: staticdev.python-developer |
| 65 | +
|
| 66 | + # role with pycharm |
| 67 | + - hosts: all |
| 68 | + roles: |
| 69 | + - role: staticdev.python-developer |
| 70 | + vars: |
| 71 | + install_pycharm: true |
| 72 | + pycharm_flavor: edu |
| 73 | +
|
| 74 | + # role with vscode and extensions |
| 75 | + - hosts: all |
| 76 | + roles: |
| 77 | + - role: staticdev.python-developer |
| 78 | + vars: |
| 79 | + install_vscode: true |
| 80 | + vscode_extensions: |
| 81 | + - ms-python.python |
| 82 | + - ms-python.vscode-pylance |
| 83 | + - shan.code-settings-sync |
| 84 | +
|
| 85 | + # role with pyenv attributes |
| 86 | + - hosts: all |
| 87 | + roles: |
| 88 | + - role: staticdev.python-developer |
| 89 | + vars: |
| 90 | + pyenv_global: "3.9.6" |
| 91 | + vscode_extensions: |
| 92 | + - "3.9.6" |
| 93 | + - "3.8.11" |
| 94 | +
|
| 95 | +
|
| 96 | +License |
| 97 | +------- |
| 98 | + |
| 99 | +MIT |
| 100 | + |
| 101 | + |
| 102 | +Author Information |
| 103 | +------------------ |
| 104 | + |
| 105 | +`staticdev`_ |
| 106 | + |
| 107 | +.. _Cookiecutter Hypermodern Python: https://github.com/cjolowicz/cookiecutter-hypermodern-python |
| 108 | +.. _gantsign.visual-studio-code: https://galaxy.ansible.com/gantsign/visual-studio-code |
| 109 | +.. _staticdev: https://github.com/staticdev |
| 110 | +.. _staticdev.pyenv: https://galaxy.ansible.com/staticdev/pyenv |
0 commit comments