@@ -105,8 +105,8 @@ def __init__(
105
105
self .shell = shell
106
106
self .cwd = cwd or settings .RTD_DOCKER_WORKDIR
107
107
self .user = user or settings .RTD_DOCKER_USER
108
- self .environment = environment .copy () if environment else {}
109
- if 'PATH' in self .environment :
108
+ self ._environment = environment .copy () if environment else {}
109
+ if 'PATH' in self ._environment :
110
110
raise BuildEnvironmentError ('\' PATH\' can\' t be set. Use bin_path' )
111
111
112
112
self .build_env = build_env
@@ -132,7 +132,7 @@ def run(self):
132
132
log .info ("Running: '%s' [%s]" , self .get_command (), self .cwd )
133
133
134
134
self .start_time = datetime .utcnow ()
135
- environment = self .environment .copy ()
135
+ environment = self ._environment .copy ()
136
136
if 'DJANGO_SETTINGS_MODULE' in environment :
137
137
del environment ['DJANGO_SETTINGS_MODULE' ]
138
138
if 'PYTHONPATH' in environment :
@@ -302,7 +302,7 @@ def run(self):
302
302
exec_cmd = client .exec_create (
303
303
container = self .build_env .container_id ,
304
304
cmd = self .get_wrapped_command (),
305
- environment = self .environment ,
305
+ environment = self ._environment ,
306
306
user = self .user ,
307
307
workdir = self .cwd ,
308
308
stdout = True ,
@@ -384,7 +384,7 @@ class BaseEnvironment:
384
384
def __init__ (self , project , environment = None ):
385
385
# TODO: maybe we can remove this Project dependency also
386
386
self .project = project
387
- self .environment = environment or {}
387
+ self ._environment = environment or {}
388
388
self .commands = []
389
389
390
390
def record_command (self , command ):
@@ -423,7 +423,7 @@ def run_command_class(
423
423
kwargs .update ({'record_as_success' : record_as_success })
424
424
425
425
# Remove PATH from env, and set it to bin_path if it isn't passed in
426
- environment = self .environment .copy ()
426
+ environment = self ._environment .copy ()
427
427
env_path = environment .pop ('BIN_PATH' , None )
428
428
if 'bin_path' not in kwargs and env_path :
429
429
kwargs ['bin_path' ] = env_path
0 commit comments