-
Notifications
You must be signed in to change notification settings - Fork 909
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
Deprecate kedro test
and kedro lint
#1873
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to point out that users should call linters directly? Do we need to specify which ones? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
) | ||
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)) | ||
|
@@ -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}"]) | ||
|
@@ -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" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be clear, this means we are not wrapping
pytest
in a Kedro command, but we're still supportingpytest
, right? Since, if we were just going to say "testing is up to you now," we shouldn't call outpytest
in the message.I think it's fine as-is, if I've understood correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will still have some tests in starters? This isn't too important though, as this deprecating message is for 0.18.x, we will still support
pytest
until 0.19.0, so this message is just asking people to usepytest
instead ofkedro test
.#1879 is a more detailed docs for how to use
pytest
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Determining whether or not tests will still be in starters is part of an open issue (#1849).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally wouldn't mention
pytest
as an alternative in this message, I think this also would keep things consistent with the linting message.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am gonna leave it as is. I don't think it matters too much and I am fine with either option.
I checked in 0.17.x we did similar thing for
kedro install
kedro/kedro/framework/cli/project.py
Lines 175 to 180 in 80c0d3a