Repository: kedro-org/kedro

Issue:
Deprecate micropackaging
After some cool-off period in #3750, we saw no indication that users have a desire of keeping our micropackaging functionality, so we decided to eventually remove it.

The first step is to deprecate it for the present 0.19.x cycle.

> Every time a user uses `kedro micropkg` a `DeprecationWarning` should be shown (or equivalent, see discussion about `FutureWarning` and `DeprecationWarning` in various places, for example https://github.com/kedro-org/kedro/issues/2744#issue-1779342165)

Since `kedro.framework.cli.micropkg` is public API too, this warning should also be shown when importing anything from that subpackage.

The warning should communicate to users that this functionality is no longer maintained and will be deleted in Kedro 0.20, and point them to https://github.com/kedro-org/kedro/issues/3750 in case they want to voice a dissenting opinion.


Discussion:
+, I think it's a nice initiative.
what's an alternative to micropackaging? Should I switch to packaging instead?
@arek544 Could you detail your use case?
I have multiple modular pipelines that l like to share between projects, so I thought micropackaging would be the best solution so far
Hi @arek544, thanks for commenting. Micropackaging does suit your use case well and that's also the use case we built the feature for. However, adoption has been very low and most users have found alternative solutions. Are you on our Slack (http://slack.kedro.org/) by any chance? It would be good to explore a different solution for you for when the time comes that micropackaging is removed from Kedro. 

Resolving patch:
diff --git a/kedro/framework/cli/micropkg.py b/kedro/framework/cli/micropkg.py
--- a/kedro/framework/cli/micropkg.py
+++ b/kedro/framework/cli/micropkg.py
@@ -124,7 +124,8 @@ def micropkg_cli() -> None:  # pragma: no cover
 
 @micropkg_cli.group()
 def micropkg() -> None:
-    """Commands for working with micro-packages."""
+    """(DEPRECATED) Commands for working with micro-packages. DeprecationWarning: micro-packaging is deprecated
+    and will not be available from Kedro 0.20.0."""
 
 
 @command_with_verbosity(micropkg, "pull")
@@ -167,7 +168,13 @@ def pull_package(  # noqa: PLR0913
     all_flag: str,
     **kwargs: Any,
 ) -> None:
-    """Pull and unpack a modular pipeline and other micro-packages in your project."""
+    """(DEPRECATED) Pull and unpack a modular pipeline and other micro-packages in your project."""
+    deprecation_message = (
+        "DeprecationWarning: Command 'kedro micropkg pull' is deprecated and "
+        "will not be available from Kedro 0.20.0."
+    )
+    click.secho(deprecation_message, fg="red")
+
     if not package_path and not all_flag:
         click.secho(
             "Please specify a package path or add '--all' to pull all micro-packages in the "
@@ -341,7 +348,13 @@ def package_micropkg(  # noqa: PLR0913
     all_flag: str,
     **kwargs: Any,
 ) -> None:
-    """Package up a modular pipeline or micro-package as a Python source distribution."""
+    """(DEPRECATED) Package up a modular pipeline or micro-package as a Python source distribution."""
+    deprecation_message = (
+        "DeprecationWarning: Command 'kedro micropkg package' is deprecated and "
+        "will not be available from Kedro 0.20.0."
+    )
+    click.secho(deprecation_message, fg="red")
+
     if not module_path and not all_flag:
         click.secho(
             "Please specify a micro-package name or add '--all' to package all micro-packages in "


Test patch: