Skip to content
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

Remove Deprecated development CLI #3065

Merged
merged 27 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 0 additions & 85 deletions docs/source/development/commands_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,13 @@ Here is a list of Kedro CLI commands, as a shortcut to the descriptions below. P
* [`kedro new`](#create-a-new-kedro-project)

* Project-specific Kedro commands
* [`kedro activate-nbstripout`](#strip-output-cells)(deprecated from version 0.19.0)
* [`kedro build-docs`](#build-the-project-documentation) (deprecated from version 0.19.0)
* [`kedro build-reqs`](#build-the-projects-dependency-tree) (deprecated from version 0.19.0)
* [`kedro catalog list`](#list-datasets-per-pipeline-per-type)
* [`kedro catalog resolve`](#resolve-dataset-factories-in-the-catalog)
* [`kedro catalog rank`](#rank-dataset-factories-in-the-catalog)
* [`kedro catalog create`](#create-a-data-catalog-yaml-configuration-file)
* [`kedro ipython`](#notebooks)
* [`kedro jupyter convert`](#copy-tagged-cells) (deprecated from version 0.19.0)
* [`kedro jupyter lab`](#notebooks)
* [`kedro jupyter notebook`](#notebooks)
* [`kedro lint`](#lint-your-project) (deprecated from version 0.19.0)
* [`kedro micropkg package <pipeline_name>`](#package-a-micro-package)
* [`kedro micropkg pull <package_name>`](#pull-a-micro-package)
* [`kedro package`](#deploy-the-project)
Expand All @@ -77,7 +72,6 @@ Here is a list of Kedro CLI commands, as a shortcut to the descriptions below. P
* [`kedro registry describe <pipeline_name>`](#describe-a-registered-pipeline)
* [`kedro registry list`](#list-all-registered-pipelines-in-your-project)
* [`kedro run`](#run-the-project)
* [`kedro test`](#test-your-project) (deprecated from version 0.19.0)

## Global Kedro commands

Expand Down Expand Up @@ -278,21 +272,6 @@ def run(

### Project setup

#### Build the project's dependency tree

```{note}
_This command will be deprecated from Kedro version 0.19.0._
```
```bash
kedro build-reqs
```

This command runs [`pip-compile`](https://github.com/jazzband/pip-tools#example-usage-for-pip-compile) on the project's `src/requirements.txt` file and will create `src/requirements.lock` with the compiled requirements.

`kedro build-reqs` has two optional arguments to specify which file to compile the requirements from and where to save the compiled requirements to. These arguments are `--input-file` and `--output-file` respectively.

`kedro build-reqs` also accepts and passes through CLI options accepted by `pip-compile`. For example, `kedro build-reqs --generate-hashes` will call `pip-compile --output-file=src/requirements.lock --generate-hashes src/requirements.txt`.

#### Install all package dependencies

The following runs [`pip`](https://github.com/pypa/pip) to install all package dependencies specified in `src/requirements.txt`:
Expand Down Expand Up @@ -381,44 +360,6 @@ The above command will take the bundled `.tar.gz` file and do the following:

### Project quality

#### Build the project documentation

```{note}
_This command will be deprecated from Kedro version 0.19.0._
```

```bash
kedro build-docs
```

The `build-docs` command builds [project documentation](../tutorial/package_a_project.md#add-documentation-to-a-kedro-project) using the [Sphinx](https://www.sphinx-doc.org) framework. To further customise your documentation, please refer to `docs/source/conf.py` and the [Sphinx documentation](http://www.sphinx-doc.org/en/master/usage/configuration.html).


#### Lint your project

```{note}
_This command will be deprecated from Kedro version 0.19.0._. We still recommend to (../development/linting.md) and you can find more help here
```

```bash
kedro lint
```

Your project is linted with [`black`](https://github.com/psf/black), [`flake8`](https://github.com/PyCQA/flake8) and [`isort`](https://github.com/PyCQA/isort).


#### Test your project

```{note}
_This command will be deprecated from Kedro version 0.19.0._
```

The following runs all `pytest` unit tests found in `src/tests`, including coverage (see the file `.coveragerc`):

```bash
kedro test
```

### Project development

#### Modular pipelines
Expand Down Expand Up @@ -544,29 +485,3 @@ The [Kedro IPython extension](../notebooks_and_ipython/kedro_and_notebooks.md#a-
* `session` (type `KedroSession`): [Kedro session](../kedro_project_setup/session.md) that orchestrates a pipeline run

To reload these variables (e.g. if you updated `catalog.yml`) use the `%reload_kedro` line magic, which can also be used to see the error message if any of the variables above are undefined.

##### Copy tagged cells

```{note}
_This command will be deprecated from Kedro version 0.19.0._
```

To copy the code from [cells tagged](https://jupyter-notebook.readthedocs.io/en/stable/changelog.html#cell-tags) with a `node` tag into Python files under `src/<package_name>/nodes/` in a Kedro project:

```bash
kedro jupyter convert --all
```

##### Strip output cells

```{note}
_This command will be deprecated from Kedro version 0.19.0._
```

Output cells of Jupyter Notebook should not be tracked by git, especially if they contain sensitive information. To strip them out:

```bash
kedro activate-nbstripout
```

This command adds a `git hook` which clears all notebook output cells before committing anything to `git`. It needs to run only once per local repository.
2 changes: 1 addition & 1 deletion docs/source/development/set_up_pycharm.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

![](../meta/images/pycharm_conf_run_dropdown.png)

For other `kedro` commands, follow same steps but replace `run` in the `Parameters` field with the other commands that are to be used (e.g., `test`, `package`, `build-docs` etc.).
For other `kedro` commands, follow same steps but replace `run` in the `Parameters` field with the other commands that are to be used (e.g., `jupyter`, `package`, `registry` etc.).

Check warning on line 81 in docs/source/development/set_up_pycharm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/source/development/set_up_pycharm.md#L81

[Kedro.abbreviations] Use 'for example' instead of abbreviations like 'e.g.,'.
Raw output
{"message": "[Kedro.abbreviations] Use 'for example' instead of abbreviations like 'e.g.,'.", "location": {"path": "docs/source/development/set_up_pycharm.md", "range": {"start": {"line": 81, "column": 136}}}, "severity": "WARNING"}

Check warning on line 81 in docs/source/development/set_up_pycharm.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/source/development/set_up_pycharm.md#L81

[Kedro.abbreviations] Use 'and more' instead of abbreviations like 'etc.'.
Raw output
{"message": "[Kedro.abbreviations] Use 'and more' instead of abbreviations like 'etc.'.", "location": {"path": "docs/source/development/set_up_pycharm.md", "range": {"start": {"line": 81, "column": 175}}}, "severity": "WARNING"}


## Debugging
Expand Down
2 changes: 0 additions & 2 deletions docs/source/faq/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ This is a growing set of technical FAQs. The [product FAQs on the Kedro website]

## Working with Jupyter

* [How can I convert functions from Jupyter Notebooks into Kedro nodes](../notebooks_and_ipython/kedro_and_notebooks.md#convert-functions-from-jupyter-notebooks-into-kedro-nodes)?

* [How do I connect a Kedro project kernel to other Jupyter clients like JupyterLab](../notebooks_and_ipython/kedro_and_notebooks.md#ipython-jupyterlab-and-other-jupyter-clients)?

## Kedro project development
Expand Down
2 changes: 1 addition & 1 deletion docs/source/get_started/kedro_concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@

### `src`

This subfolder contains the project's source code in one subfolder and another folder that you can use to add unit tests for your project. Projects are preconfigured to run tests using `pytest` when you call `kedro test` from the project's root directory.
This subfolder contains the project's source code.

Check warning on line 107 in docs/source/get_started/kedro_concepts.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/source/get_started/kedro_concepts.md#L107

[Kedro.Spellings] Did you really mean 'subfolder'?
Raw output
{"message": "[Kedro.Spellings] Did you really mean 'subfolder'?", "location": {"path": "docs/source/get_started/kedro_concepts.md", "range": {"start": {"line": 107, "column": 6}}}, "severity": "WARNING"}
26 changes: 0 additions & 26 deletions docs/source/notebooks_and_ipython/kedro_and_notebooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,32 +192,6 @@ For more details, run `%reload_kedro?`.

If you have [Kedro-Viz](https://github.com/kedro-org/kedro-viz) installed for the project you can display an interactive visualisation of your pipeline directly in your Notebook using the [line magic](https://ipython.readthedocs.io/en/stable/interactive/magics.html) `%run_viz`.


## Convert functions from Jupyter Notebooks into Kedro nodes

If you are writing experimental code in your Notebook and later want to convert functions you've written to Kedro nodes, you can do this using tags.

Say you have the following code in your Notebook:

```ipython
def some_action():
print("This function came from `notebooks/my_notebook.ipynb`")
```

1. Enable tags toolbar: `View` menu -> `Cell Toolbar` -> `Tags`
![Enable the tags toolbar graphic](../meta/images/jupyter_notebook_workflow_activating_tags.png)

2. Add the `node` tag to the cell containing your function
![Add the node tag graphic](../meta/images/jupyter_notebook_workflow_tagging_nodes.png)

```{note}
The Notebook can contain multiple functions tagged as `node`, each of them will be exported into the resulting Python file
```

3. Save your Jupyter Notebook to `notebooks/my_notebook.ipynb`
4. From your terminal, run `kedro jupyter convert notebooks/my_notebook.ipynb` from the Kedro project directory. The output is a Python file `src/<package_name>/nodes/my_notebook.py` containing the `some_action` function definition
5. The `some_action` function can now be used in your Kedro pipelines

## Useful to know...
Each Kedro project has its own Jupyter kernel so you can switch between multiple Kedro projects from a single Jupyter instance simply by selecting the appropriate kernel.

Expand Down
7 changes: 0 additions & 7 deletions docs/source/tutorial/package_a_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ pip install sphinx
```

### Set up the Sphinx project files

```{warning}
Currently, Kedro projects are created with a `docs/source` subdirectory, which gets pre-populated with two Sphinx configuration files (`conf.py`, and `index.rst`), needed by the `kedro build-docs` command. This command is deprecated; it will be removed in Kedro version 0.19, along with those dummy files.

Before proceeding with these instructions, back up the contents of `docs/source/index.rst` and remove both `docs/source/conf.py` and `docs/source/index.rst`.
```

First, run the following command:

```bash
Expand Down
17 changes: 0 additions & 17 deletions features/activate_nbstripout.feature

This file was deleted.

11 changes: 0 additions & 11 deletions features/build_docs.feature

This file was deleted.

13 changes: 0 additions & 13 deletions features/build_reqs.feature

This file was deleted.

8 changes: 0 additions & 8 deletions features/jupyter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,3 @@ Feature: Jupyter targets in new project
When I execute the kedro jupyter command "lab --no-browser"
Then I wait for the jupyter webserver to run for up to "120" seconds
Then Jupyter Lab should run on port 8888

Scenario: Execute node convert into Python files
Given I have added a test jupyter notebook
When I execute the test jupyter notebook and save changes
And I execute the kedro jupyter command "convert --all"
And Wait until the process is finished for up to "120" seconds
Then I should get a successful exit code
And Code cell with node tag should be converted into kedro node
11 changes: 0 additions & 11 deletions features/package.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,3 @@ Feature: Package target in new project
When I install the project's python package
And I execute the installed project package
Then I should get a successful exit code

@fresh_venv
Scenario: Install package after running kedro build-reqs
Given I have updated kedro requirements
When I execute the kedro command "build-reqs --resolver=backtracking"
Then I should get a successful exit code
When I execute the kedro command "package"
Then I should get a successful exit code
When I install the project's python package
And I execute the installed project package
Then I should get a successful exit code
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
project's structure, and in files named test_*.py. They are simply functions
named ``test_*`` which test a unit of logic.

To run the tests, run ``kedro test`` from the project root directory.
To run the tests, run ``pytest`` from the project root directory.
"""

from pathlib import Path
Expand Down
13 changes: 0 additions & 13 deletions features/test.feature

This file was deleted.

Loading