From af8418aea8b988fe946770843e68ec29af44af89 Mon Sep 17 00:00:00 2001 From: staticdev Date: Tue, 19 Jan 2021 20:06:48 +0100 Subject: [PATCH] Remove pycharm role dependency --- README.md | 2 ++ defaults/main.yml | 1 + handlers/main.yml | 5 ++++- meta/main.yml | 7 ++----- requirements.yml | 3 --- tasks/main.yml | 5 +++-- tasks/pycharm.yml | 5 +++-- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 20a5096..7c53bd5 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ None. Here is the list of all variables and their default values: - `install_pycharm`: `false` +- `pycharm_flavor`: `pycharm-community`. You can use also `pycharm-professional` or `pycharm-educational`. - `install_vscode`: `false` - `vscode_extensions`: optional list of name_ids of extensions. eg.: ms-python.python (Python Official Extension) @@ -47,6 +48,7 @@ Here is the list of all variables and their default values: - role: staticdev.python-developer vars: install_pycharm: true + pycharm_flavor: pycharm-educational # role with vscode and extensions - hosts: all diff --git a/defaults/main.yml b/defaults/main.yml index 3e98099..3bca8cb 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,3 +1,4 @@ --- install_pycharm: false +pycharm_flavor: pycharm-community install_vscode: false diff --git a/handlers/main.yml b/handlers/main.yml index 19258d1..b508202 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,2 +1,5 @@ --- -# handlers file for staticdev.python-developer +- name: delete poetry installer + file: + path: "/home/{{ lookup('env', 'USER') }}/get-poetry.py" + state: absent diff --git a/meta/main.yml b/meta/main.yml index 885ce10..e105f80 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -34,11 +34,8 @@ galaxy_info: - precommit dependencies: - - name: avanov.pyenv - version: 1.1.0 - # - name: oefenweb.pycharm - # version: v5.0.7 - # when: "{{ install_pycharm }}" + - name: staticdev.ansible_galaxy_pyenv + version: 1.1.1 # - name: gantsign.visual-studio-code # version: 6.6.0 # when: "{{ install_vscode }}" diff --git a/requirements.yml b/requirements.yml index 061e8c2..2720ed7 100644 --- a/requirements.yml +++ b/requirements.yml @@ -2,9 +2,6 @@ roles: - name: staticdev.ansible_galaxy_pyenv version: 1.1.1 - - name: oefenweb.pycharm - version: v5.0.7 - when: "{{ install_pycharm }}" - name: gantsign.visual-studio-code version: 6.6.0 when: "{{ install_vscode }}" diff --git a/tasks/main.yml b/tasks/main.yml index 3aafc98..f21c4f7 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,7 @@ --- - name: Install pyenv import_role: - name: avanov.pyenv + name: staticdev.ansible_galaxy_pyenv vars: pyenv_owner: "{{ lookup('env', 'USER') }}" pyenv_path: "{{ lookup('env', 'HOME') }}/pyenv" @@ -39,12 +39,13 @@ changed_when: false ignore_errors: true -- name: Download poetry +- name: Download poetry installer get_url: url: https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py dest: "{{ lookup('env', 'HOME') }}" mode: "0400" when: poetry_version_cmd is failed + notify: delete poetry installer - name: Install poetry command: "python {{ lookup('env', 'HOME') }}/get-poetry.py" diff --git a/tasks/pycharm.yml b/tasks/pycharm.yml index 71b68b5..ebe52ca 100644 --- a/tasks/pycharm.yml +++ b/tasks/pycharm.yml @@ -1,5 +1,6 @@ --- - name: Install pycharm - include_role: - name: oefenweb.pycharm + community.general.snap: + name: "{{ pycharm_flavor }}" + classic: true become: true