Closed saksham189 closed 6 years ago
I would dearly love to see https://github.com/coala/coala-bears/blob/master/bears/generate_package.py moved from coala-bears to a different location. it could be coala, cib, dependency_management. I really dont care. Ah, https://github.com/coala/coala-bears/issues/1199 is the related issue in that repo. And PEP 420 (https://github.com/coala/coala/issues/3545) is why I want it removed .. ;-)
Also I would like to see some evaluation of https://github.com/mbodenhamer/depman (who is a co-mentor on this project) to see if some of its functionality may help this project.
Before performing review itself I would like to raise several questions/topics; if they're out of the scope please just skip it; if it could be a critical open question - I suggest to mention it in the doc:
We could get the password using
import getpass getpass.getpass('Password:')
if root access is required.
If more than 1 package managers are available to install the linter on the platform, I think we could simply chose any 1 and continue. But if we should be giving a higher priority to any one such as apt-get
over yum
then they could be arranged in that order of priority.
For conflicting dependencies, print a warning to the user regarding the conflict or simply putting out verbose
output of running the command.
Another packaging system which probably has enough complexity to meet our needs is the Ansible packaging modules.
@jayvdb Nice one, here is the link to the source code: https://github.com/ansible/ansible/tree/devel/lib/ansible/modules/packaging Please note that the license is GPL-3.0
This looks very cool! we could create a new role for package management and easily install dependencies for different platforms. I will investigate more and change cEP accordingly.
I have read the documentation for ansible
. It is simple to install packages
- name: install basic package
action: >
{{ ansible_pkg_mgr }} name=some_name state=present
Information such as ansible_pkg_mgr
is automatically collected by ansible
from the host.
DartLintBear
can also be handled without using conda packages.
- name: install some package based on distro
pip: name=some_name state=latest
when: ansible_distribution == "Darwin"
- name: install some package based on distro
apt: name=some_name upgrade=dist
when: ansible_distribution == "Ubuntu"
Again ansible_distribution
is collected by ansible
.
Also, if we create a large playbook and add tags for the installation of each bear as shown
tasks:
- name: Install PycodeStyleBear
pip:
name: PycodeStyleBear
state: latest
tags: PycodeStyleBear
ansible-playbook example.yml --tags "PycodeStyleBear"
This would install the required Bear
. Tags are reusable so, we could add language tags etc. to filter and install the required bears. The only problem being that if the user forgets to specify tags
option then all the bears would get installed.
Also, there are other option such as --ask-become-pass --become-method=sudo
to gain root access. I will update this cEP soon.
@Udayan12167 please review
@gitmate-bot ff
Hey! I'm GitMate.io! This pull request is being fastforwarded automatically. Please DO NOT push while fastforward is in progress or your changes would be lost permanently :warning:
Automated fastforward with GitMate.io was successful! :tada:
Closes https://github.com/coala/cEPs/issues/10