ahelal / avm

Ansible Version Manager (AVM)
MIT License
24 stars 1 forks source link

Requirements in setup wrapper script #12

Open valentinocossar opened 6 years ago

valentinocossar commented 6 years ago

Hi, could I use requirements also in the setup wrapper script and not only in the setup command?

And if I install passlib with pip install passlib (and not as requirement), will be used with every version of Ansible that I've installed via AVM?

Thank you.

ahelal commented 6 years ago

Hi,

Yes the requirements will run with every install of Ansible.

Behind the scenes python virtualenv is being used so all virtualenv rules apply. So my best guess passlib will not work if you install outside the virtualenv. Although there is work around related to path, but could be ugly.

Hope that helps

valentinocossar commented 6 years ago

Thank you for the answer.

How can I use requirements with setup wrapper script? I can't find any parameter to add to the file to declare the requirements for each virtualenv.

If I want to install a new pip package in a specific virtualenv, could I do it manually, running pip install passlib for every virtualenv?

I'm sorry for all these questions, but I have to break my environment to test this tool, so I would like to have some answers before starting the installation.

ahelal commented 6 years ago

Np :)

you can use PYTHON_REQUIREMENTS_INDEX

export ANSIBLE_VERSIONS_0="2.3.1.0"
export INSTALL_TYPE_0="pip"
export ANSIBLE_LABEL_0="v2.3"
export PYTHON_REQUIREMENTS_0="/path/requirements.txt"

# Use a special requirement file with passlib 
export ANSIBLE_VERSIONS_1="2.3.1.0"
export INSTALL_TYPE_1="pip"
export ANSIBLE_LABEL_1="v2.3-special"
export PYTHON_REQUIREMENTS_1="/path/requirements_special.txt"

Hope that helps