/
conda.py
59 lines (49 loc) · 1.82 KB
/
conda.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the niceman package for the
# copyright and license terms.
#
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""Orchestrator sub-class to provide management of the localhost environment."""
from niceman.distributions import Distribution
import logging
lgr = logging.getLogger('niceman.distributions.conda')
class CondaDistribution(Distribution):
"""
Class to provide Conda package management.
"""
def __init__(self, provenance):
"""
Class constructor
Parameters
----------
provenance : dictionary
Provenance information for the distribution.
"""
super(CondaDistribution, self).__init__(provenance)
def initiate(self, environment):
"""
Perform any initialization commands needed in the environment environment.
Parameters
----------
environment : object
The Environment sub-class object.
"""
return
def install_packages(self, environment):
"""
Install the packages associated to this distribution by the provenance
into the environment environment.
Parameters
----------
environment : object
Environment sub-class instance.
"""
# TODO: Need to figure out a graceful way to install conda before we can install packages here.
# for package in self.provenance['packages']:
# environment.add_command(['conda',
# 'install',
# package['name']])
return