Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve all path in Kedro #3742

Merged
merged 11 commits into from
Apr 2, 2024
Prev Previous commit
Next Next commit
fix broken type hint and resolve project path
Signed-off-by: Nok Lam Chan <[email protected]>
noklam committed Mar 26, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit fbe1b9c940cca41c4298442d5d5d7c3d367f2c74
4 changes: 3 additions & 1 deletion kedro/framework/startup.py
Original file line number Diff line number Diff line change
@@ -144,10 +144,12 @@ def _add_src_to_path(source_dir: Path, project_path: Path) -> None:
os.environ["PYTHONPATH"] = f"{str(source_dir)}{sep}{python_path}"


def bootstrap_project(project_path: Path) -> ProjectMetadata:
def bootstrap_project(project_path: str | Path) -> ProjectMetadata:
"""Run setup required at the beginning of the workflow
when running in project mode, and return project metadata.
"""

project_path = Path(project_path).resolve()
metadata = _get_project_metadata(project_path)
_add_src_to_path(metadata.source_dir, project_path)
configure_project(metadata.package_name)