-
Notifications
You must be signed in to change notification settings - Fork 906
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
Add documentation about pyproject.toml
#2427
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
20c9b57
first draft pyproject.toml
ankatiyar 41cd709
Update docs/source/kedro_project_setup/settings.md
ankatiyar 47a1605
Apply suggestions from code review
ankatiyar 32128fc
lint + fix rtd build
ankatiyar 75a36a5
Merge branch 'main' into docs/pyproject-toml
ankatiyar aa79fe1
Merge branch 'main' into docs/pyproject-toml
stichbury 7f2480a
Fix linting errors introduced by merge from FAQ changes
stichbury 60de254
Merge branch 'main' into docs/pyproject-toml
ankatiyar be6a43f
Merge branch 'main' into docs/pyproject-toml
ankatiyar 6e584d5
Merge branch 'main' into docs/pyproject-toml
ankatiyar 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
# Project settings | ||
|
||
## Application settings | ||
|
||
A Kedro project's `settings.py` file contains the application settings for the project, including registration of Hooks and library components. This page explains how settings work, and which settings are available. | ||
|
||
```{note} | ||
Application settings is distinct from [run time configuration](configuration.md), which is stored in the `conf` folder and can vary by configuration environment, and according to the contents of `pyproject.toml`, which provides project metadata such as `package_name`, `project_name` and `project_version` (the version of Kedro with which the project was generated). | ||
Application settings is distinct from [run time configuration](configuration.md), which is stored in the `conf` folder and can vary by configuration environment, and [pyproject.toml](#project-metadata) , which provides project metadata and build configuration. | ||
``` | ||
|
||
By default, all code in `settings.py` is commented out. When settings are not supplied, Kedro chooses sensible default values. You only need to edit `settings.py` if you wish to change to values other than the defaults. | ||
|
@@ -19,3 +21,22 @@ By default, all code in `settings.py` is commented out. When settings are not su | |
| `CONFIG_LOADER_CLASS` | `kedro.config.ConfigLoader` | Customise how project configuration is handled. | | ||
| `CONFIG_LOADER_ARGS` | `dict()` | Keyword arguments for the `CONFIG_LOADER_CLASS` constructor. | | ||
| `DATA_CATALOG_CLASS` | `kedro.io.DataCatalog` | Customise how the [Data Catalog](../data/data_catalog.md) is handled. | | ||
|
||
## Project metadata | ||
The `pyproject.toml` file is the standard way to store build metadata and tool settings for Python projects. | ||
Every Kedro project comes with a default pre-populated `pyproject.toml` file in your project root directory with the following keys specified under the `[tool.kedro]` section: | ||
|
||
```toml | ||
[tool.kedro] | ||
package_name = package_name | ||
project_name = project_name | ||
kedro_init_version = kedro_version | ||
``` | ||
|
||
The `package_name` should be a [valid Python package name](https://peps.python.org/pep-0423/) and the `project_name` should be a human-readable name. They are both mandatory keys for your project. | ||
`kedro_init_version` specifies the version of Kedro the project was created with. When you upgrade to a newer Kedro version, | ||
this value should also be updated. | ||
|
||
You can also use `pyproject.toml` to specify settings for functionalities such as [micro-packaging](../nodes_and_pipelines/micro_packaging.md). | ||
You can also store the settings for the other tools you've used in your project, such as [`pytest` for automated testing](../development/automated_testing.md). | ||
Consult the respective documentation for the tools you have used to check how you can configure the settings with the `pyproject.toml` file for your project. | ||
Comment on lines
+40
to
+42
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. Just a wild idea, can we link our |
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.
Isn't it the version of the "starter"? Just double checking
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 it's the version of Kedro used to create the project. It's also there when you make a blank project with
kedro new