Add bootstrap_rattail_base() and related tweaks

the idea here is to have a "one stop shop" for base requirements,
we'll see how useful it is in practice i guess
This commit is contained in:
Lance Edgar 2021-06-11 18:38:16 -05:00
parent 506b88d3e2
commit 1fd9ad48d6
3 changed files with 66 additions and 21 deletions

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2020 Lance Edgar
# Copyright © 2010-2021 Lance Edgar
#
# This file is part of Rattail.
#
@ -29,16 +29,19 @@ from contextlib import contextmanager
from rattail_fabric2 import apt, append, exists, make_deploy, mkdir
deploy = make_deploy(__file__)
deploy_common = make_deploy(__file__)
def bootstrap_python(c, pip_from_apt=True, pip_eager=True,
def bootstrap_python(c, deploy=None,
pip_from_apt=True,
pip_eager=True,
pip_method=None,
pip_auto=False,
pip_package_name=None,
virtualenvwrapper_from_apt=False,
upgrade_virtualenvwrapper=True,
workon_home='/srv/envs', user='rattail',
workon_home='/srv/envs',
user='rattail',
python3=False):
"""
Bootstrap a "complete" Python install.
@ -67,7 +70,8 @@ def bootstrap_python(c, pip_from_apt=True, pip_eager=True,
use_apt=virtualenvwrapper_from_apt,
upgrade=upgrade_virtualenvwrapper,
configure_me=False)
deploy(c, 'python/premkvirtualenv', '{}/premkvirtualenv'.format(workon_home), owner=user, use_sudo=True)
# TODO: let custom deploy override this
deploy_common(c, 'python/premkvirtualenv', '{}/premkvirtualenv'.format(workon_home), owner=user, use_sudo=True)
def install_pythonz(c):