Skip to content

Commit

Permalink
Deprecate kedro test and kedro lint (kedro-org#1873)
Browse files Browse the repository at this point in the history
* Deprecating `kedro test` and `kedro lint`

Signed-off-by: Nok Chan <[email protected]>

* Deprecate commands

Signed-off-by: Nok Chan <[email protected]>

* Make kedro looks prettier

* Update Linting

Signed-off-by: Nok <[email protected]>

Signed-off-by: Nok Chan <[email protected]>
Signed-off-by: Nok <[email protected]>
Signed-off-by: nickolasrm <[email protected]>
  • Loading branch information
noklam authored and nickolasrm committed Oct 26, 2022
1 parent c52bdd6 commit 70a64b5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
5 changes: 3 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@

## Bug fixes and other changes

* Fixed `format` in `save_args` for `SparkHiveDataSet`, previously it didn't allow you to save it as delta format.
## Upcoming deprecations for Kedro 0.19.0

## Breaking changes to the API
* `kedro test` and `kedro lint` will be deprecated.
* Fixed `format` in `save_args` for `SparkHiveDataSet`, previously it didn't allow you to save it as delta format.

# Release 0.18.3

Expand Down
26 changes: 21 additions & 5 deletions kedro/framework/cli/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@ def project_group(): # pragma: no cover
@forward_command(project_group, forward_help=True)
@click.pass_obj # this will pass the metadata as first argument
def test(metadata: ProjectMetadata, args, **kwargs): # pylint: disable=unused-argument
"""Run the test suite."""
"""Run the test suite. (DEPRECATED)"""
deprecation_message = (
"DeprecationWarning: Command 'kedro test' is deprecated and "
"will not be available from Kedro 0.19.0. "
"Use the command 'pytest' instead. "
)
click.secho(deprecation_message, fg="red")

try:
_check_module_importable("pytest")
except KedroCliError as exc:
Expand All @@ -90,7 +97,13 @@ def test(metadata: ProjectMetadata, args, **kwargs): # pylint: disable=unused-a
def lint(
metadata: ProjectMetadata, files, check_only, **kwargs
): # pylint: disable=unused-argument
"""Run flake8, isort and black."""
"""Run flake8, isort and black. (DEPRECATED)"""
deprecation_message = (
"DeprecationWarning: Command 'kedro lint' is deprecated and "
"will not be available from Kedro 0.19.0."
)
click.secho(deprecation_message, fg="red")

source_path = metadata.source_dir
package_name = metadata.package_name
files = files or (str(source_path / "tests"), str(source_path / package_name))
Expand Down Expand Up @@ -171,13 +184,15 @@ def package(metadata: ProjectMetadata):
@click.pass_obj # this will pass the metadata as first argument
def build_docs(metadata: ProjectMetadata, open_docs):
"""Build the project documentation. (DEPRECATED)"""
source_path = metadata.source_dir
package_name = metadata.package_name
deprecation_message = (
"DeprecationWarning: Command 'kedro build-docs' is deprecated and "
"will not be available from Kedro 0.19.0."
)
click.secho(deprecation_message, fg="red")

source_path = metadata.source_dir
package_name = metadata.package_name

python_call("pip", ["install", str(source_path / "[docs]")])
python_call("pip", ["install", "-r", str(source_path / "requirements.txt")])
python_call("ipykernel", ["install", "--user", f"--name={package_name}"])
Expand Down Expand Up @@ -262,12 +277,13 @@ def activate_nbstripout(
metadata: ProjectMetadata, **kwargs
): # pylint: disable=unused-argument
"""Install the nbstripout git hook to automatically clean notebooks. (DEPRECATED)"""
source_path = metadata.source_dir
deprecation_message = (
"DeprecationWarning: Command 'kedro activate-nbstripout' is deprecated and "
"will not be available from Kedro 0.19.0."
)
click.secho(deprecation_message, fg="red")

source_path = metadata.source_dir
click.secho(
(
"Notebook output cells will be automatically cleared before committing"
Expand Down

0 comments on commit 70a64b5

Please sign in to comment.