Julian Nowak
03/20/2024, 3:26 PMkedro new --name=<your-project-name> --example=yes
) it's created separately on the same level as /src. Is this a bug or a feature?Julian Nowak
03/20/2024, 3:28 PMDeepyaman Datta
03/20/2024, 3:28 PMsrc
, and this is a known issue that needs to be updated.Deepyaman Datta
03/20/2024, 3:29 PMJulian Nowak
03/20/2024, 3:30 PMDeepyaman Datta
03/20/2024, 3:31 PMNok Lam Chan
03/20/2024, 3:42 PMNok Lam Chan
03/20/2024, 3:43 PMJulian Nowak
03/20/2024, 3:51 PM@Nok Lam Chan sure, on this one: https://github.com/kedro-org/kedro/issues/1271?
Julian Nowak
03/20/2024, 3:53 PMNok Lam Chan
03/20/2024, 3:53 PMNok Lam Chan
03/20/2024, 3:54 PMDeepyaman Datta
03/20/2024, 4:00 PMJulian Nowak
03/20/2024, 4:03 PMfrom {project}.pipelines.common_methods import _to_numeric
when I reference the dataset in its test:
from src.{project}.datasets.my_dataset import MyDataset
(now I have to add this src.
, right?)
and run pytest
I get the error
src\{project}\datasets\MyDataset.py:13: in <module>
from {project}.pipelines.common_methods import _to_numeric
E ModuleNotFoundError: No module named '{project}'
Should I add my project to pytonpath in some other way that it is done by default?Deepyaman Datta
03/20/2024, 4:04 PMfrom src
Deepyaman Datta
03/20/2024, 4:09 PMDeepyaman Datta
03/20/2024, 4:09 PMJulian Nowak
03/20/2024, 4:10 PMpip install .
doesTakieddine Kadiri
03/20/2024, 4:15 PMpip install -e .
Julian Nowak
03/20/2024, 4:16 PMTakieddine Kadiri
03/20/2024, 4:24 PMpip install
approach you're not relying on kedro nor on pytest for adding your packages that live under src
to the sys path, you could then import your package from whatever module that live inside your python env.
You're however relying on Kedro's template that preconfigure the pyproject.toml
to play well with the src layout.Julian Nowak
03/20/2024, 4:27 PM