MCPcopy Index your code
hub / github.com/python/cpython / run

Function run

Platforms/Apple/__main__.py:95–118  ·  view source on GitHub ↗

Run a command in an Apple development environment. Optionally logs the executed command to the console.

(
    command: ArgsT,
    *,
    host: str | None = None,
    env: EnvironmentT | None = None,
    log: bool | None = True,
    **kwargs,
)

Source from the content-addressed store, hash-verified

93
94
95def run(
96 command: ArgsT,
97 *,
98 host: str | None = None,
99 env: EnvironmentT | None = None,
100 log: bool | None = True,
101 **kwargs,
102) -> subprocess.CompletedProcess:
103 """Run a command in an Apple development environment.
104
105 Optionally logs the executed command to the console.
106 """
107 kwargs.setdefault("check", True)
108 if env is None:
109 env = os.environ.copy()
110
111 if host:
112 host_env = apple_env(host)
113 print_env(host_env)
114 env.update(host_env)
115
116 if log:
117 print(">", join_command(command))
118 return subprocess.run(command, env=env, **kwargs)
119
120
121def join_command(args: str | Path | ArgsT) -> str:

Callers 8

configure_build_pythonFunction · 0.70
make_build_pythonFunction · 0.70
downloadFunction · 0.70
configure_host_pythonFunction · 0.70
make_host_pythonFunction · 0.70
create_xcframeworkFunction · 0.70
packageFunction · 0.70
testFunction · 0.70

Calls 7

apple_envFunction · 0.85
print_envFunction · 0.70
join_commandFunction · 0.70
setdefaultMethod · 0.45
copyMethod · 0.45
updateMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected