MCPcopy Create free account
hub / github.com/crewAIInc/crewAI / write

Function write

lib/cli/tests/test_run_crew.py:1423–1434  ·  view source on GitHub ↗
(main_py: str, *, kickoff_script: bool = True)

Source from the content-addressed store, hash-verified

1421 package = f"inputs_probe_{tmp_path.name.replace('-', '_')}"
1422
1423 def write(main_py: str, *, kickoff_script: bool = True) -> Path:
1424 scripts = f'[project.scripts]\nkickoff = "{package}.main:kickoff"\n'
1425 (tmp_path / "pyproject.toml").write_text(
1426 f'[project]\nname = "{package}"\n'
1427 + (scripts if kickoff_script else "")
1428 + '[tool.crewai]\ntype = "flow"\n'
1429 )
1430 source = tmp_path / "src" / package
1431 source.mkdir(parents=True)
1432 (source / "__init__.py").write_text("")
1433 (source / "main.py").write_text(main_py)
1434 return tmp_path
1435
1436 monkeypatch.chdir(tmp_path)
1437 monkeypatch.setenv("UV_RUN_RECURSION_DEPTH", "1")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected