MCPcopy Create free account
hub / github.com/apache/arrow / _read_env

Method _read_env

dev/archery/archery/docker/core.py:80–100  ·  view source on GitHub ↗

Read .env and merge it with explicitly passed parameters.

(self, dotenv_path, params)

Source from the content-addressed store, hash-verified

78 self._read_config(config_path, compose_bin)
79
80 def _read_env(self, dotenv_path, params):
81 """
82 Read .env and merge it with explicitly passed parameters.
83 """
84 self.dotenv = dotenv_values(str(dotenv_path))
85 if params is None:
86 self.params = {}
87 else:
88 self.params = {k: v for k, v in params.items() if k in self.dotenv}
89
90 # forward the process' environment variables
91 self.env = os.environ.copy()
92 # set the defaults from the dotenv files
93 self.env.update(self.dotenv)
94 # override the defaults passed as parameters
95 self.env.update(self.params)
96
97 # translate docker's architecture notation to a more widely used one
98 arch = self.env.get('ARCH', 'amd64')
99 self.env['ARCH_ALIAS'] = _arch_alias_mapping.get(arch, arch)
100 self.env['ARCH_SHORT'] = _arch_short_mapping.get(arch, arch)
101
102 def _read_config(self, config_path, compose_bin):
103 """

Callers 1

__init__Method · 0.95

Calls 2

copyMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected