-
Notifications
You must be signed in to change notification settings - Fork 913
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
[KED-2821] Convert all imports according to packaging specs in pyproject.toml #1304
Comments
We talked about the experience of packaging/pulling modular pipelines, and how we can actually think of it as Worked example detailed in #1304 (comment). Main ideas & proposed actions:
Out of scope: When a path is added to the Open question: |
Translating whiteboard exerciseIn a tree like:
With a [tool.kedro.pipeline.package]
"utils.cleaning.impute" = {alias = "banking_impute"}
"utils.cleaning.nullify" = {alias = "banking_nullify"}
[tool.kedro.pipeline.pull]
"banking_impute" = {alias = "pkg.utils.cleaning"} If we try to package from pkg.pipelines.clean_pipeline.nulify import nodes # can package, no problem
from pkg.utils.cleaning.impute import main # turn into `from banking_impute import main`, then package
from pkg.utils.features.windowing import daily # can't package, needs to be at least in `pyproject.toml` As mentioned before, upstream imports are not allowed. In practice: if we try to package from pkg.utils import another_utility |
Updated all docs and CI to follow the new github naming convention (main)
Updated all docs and CI to follow the new github naming convention (main) Signed-off-by: Laurens Vijnck <laurens_vijnck@mckinsey.com>
This question is being addressed separately in #1478 |
This issue was discussed in Technical Design on 14/12
|
Is this whole import mangling worth the effort? Maybe we could tell users "refactor common code/functions that are not in the pipeline itself as a separate package, then declare it as a dependency". (Simplistic question meant to spark discussion and, in line with what @merelcht said right above, talk to our users about the micropackaging workflow). |
I think we need to decide what to do with the micropackaging feature as a whole before introducing any more features like the suggested one here. |
Closing for now, we can always revisit in the future |
At
kedro pipeline package
time, check if there are any packaging specs in pyproject.toml (keys under[tool.kedro.pipeline.package]
). If so, refactor all imports according to the aliasing made explicit in the manifest.In the example above, utils should be renamed to sigma (and any references inside it to alpha should refer to beta), alpha to beta (and any references inside it to utils should refer to sigma), etc.
❓ How to work out the ideal order?
❓ Would working on a shadow-copy of the whole (or part of the) project help here?
❓ Checkout how nested packages would work, e.g. the
alpha
andalpha.utils
. Consider doing top-level packages first, and then the nested ones.For more context see comments on the original issue, copied over below.
The text was updated successfully, but these errors were encountered: