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

Update docs on installing development requirements #4178

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Upcoming Release

## Major features and improvements
* Moved development requirements from `requirements.txt` to the dedicated section in `pyproject.toml` for project template.
* Implemented `Protocol` abstraction for the current `DataCatalog` and adding new catalog implementations.
* Refactored `kedro run` and `kedro catalog` commands.
* Moved pattern resolution logic from `DataCatalog` to a separate component - `CatalogConfigResolver`. Updated `DataCatalog` to use `CatalogConfigResolver` internally.
Expand Down
29 changes: 22 additions & 7 deletions docs/source/development/automated_testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,36 @@ There are many testing frameworks available for Python. One of the most popular

Let's look at how you can start working with `pytest` in your Kedro project.

### Prerequisite: Install your Kedro project
### Install test requirements
Before getting started with test requirements, it is important to ensure you have installed your project locally. This allows you to test different parts of your project by importing them into your test files.


To install your project including all the project-specific dependencies and test requirements:
1. Add the following section to the `pyproject.toml` file located in the project root:
```toml
[project.optional-dependencies]
dev = [
"pytest-cov",
"pytest-mock",
"pytest",
]
```

2. Navigate to the root directory of the project and run:
```bash
pip install ."[dev]"
```

Before getting started with `pytest`, it is important to ensure you have installed your project locally. This allows you to test different parts of your project by importing them into your test files.
Alternatively, you can individually install test requirements as you would install other packages with `pip`, making sure you have installed your project locally and your [project's virtual environment is active](../get_started/install.md#create-a-virtual-environment-for-your-kedro-project).

To install your project, navigate to your project root and run the following command:
1. To install your project, navigate to your project root and run the following command:

```bash
pip install -e .
```

>**NOTE**: The option `-e` installs an editable version of your project, allowing you to make changes to the project files without needing to re-install them each time.
### Install `pytest`

Install `pytest` as you would install other packages with `pip`, making sure your [project's virtual environment is active](../get_started/install.md#create-a-virtual-environment-for-your-kedro-project).

2. Install test requirements one by one:
```bash
pip install pytest
```
Expand Down
12 changes: 6 additions & 6 deletions docs/source/development/linting.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ There are a variety of Python tools available to use with your Kedro projects. T
type.

### Install the tools
Install `ruff` by adding the following lines to your project's `requirements.txt`
file:
```text
ruff # Used for linting, formatting and sorting module imports
To install `ruff` add the following section to the `pyproject.toml` file located in the project root:
```toml
[project.optional-dependencies]
dev = ["ruff"]
```

To install all the project-specific dependencies, including the linting tools, navigate to the root directory of the
Then to install your project including all the project-specific dependencies and the linting tools, navigate to the root directory of the
project and run:

```bash
pip install -r requirements.txt
pip install ."[dev]"
```

Alternatively, you can individually install the linting tools using the following shell commands:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ docs = [
"Jinja2<3.2.0",
"myst-parser>=1.0,<2.1"
]
dev = [
"pytest-cov~=3.0",
"pytest-mock>=1.7.1, <2.0",
"pytest~=7.2",
"ruff~=0.1.8"
]


[tool.setuptools.dynamic]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,3 @@ ipython>=8.10
jupyterlab>=3.0
notebook
kedro~={{ cookiecutter.kedro_version }}
pytest-cov~=3.0
pytest-mock>=1.7.1, <2.0
pytest~=7.2
ruff~=0.1.8
Loading