Skip to content

Commit

Permalink
Change to short names for tools in config file (#3499)
Browse files Browse the repository at this point in the history
* Change to short names for tools in config file
---------
Signed-off-by: Dmitry Sorokin <dmd40in@gmail.com>
Signed-off-by: Dmitry Sorokin <40151847+DimedS@users.noreply.github.com>
Co-authored-by: Ahdra Merali <90615669+AhdraMeraliQB@users.noreply.github.com>
  • Loading branch information
DimedS committed Jan 18, 2024
1 parent 4be957c commit d6a78f4
Show file tree
Hide file tree
Showing 7 changed files with 233 additions and 333 deletions.
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

## Breaking changes to the API
* Added logging about not using async mode in `SequentiallRunner` and `ParallelRunner`.
* Changed input format for tools option obtained from --config file from numbers to short names.

## Documentation changes
* Added documentation about `bootstrap_project` and `configure_project`.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/starters/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ The configuration file must contain:

Additionally, the configuration file may contain:

* `tools`: The tools to customise your project setup with. Select from comma-separated values, ranges, or 'all/none'. Omitting this from your configuration file will result in the default selection of `none`.
* `example`: Indicate `yes` or `no` to select whether you would like your project to be populated with example code. Omitting this from your configuration file will result in the default selection of `no`.
* `tools`: The tools to customise your project setup with. Select from comma-separated values `lint, test, log, docs, data, pyspark, viz` or `all/none`. Omitting this from your configuration file will result in the default selection of `none`.
* `example_pipeline`: Indicate `yes` or `no` to select whether you would like your project to be populated with example code. Omitting this from your configuration file will result in the default selection of `no`.

The `output_dir` can be specified as `~` for the home directory or `.` for the current working directory. Here is an example `config.yml`, which assumes that a directory named `~/code` already exists:

Expand Down
2 changes: 1 addition & 1 deletion docs/source/starters/new_project_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ As an alternative to the interactive project creation workflow, you can also sup
"my project"

"tools":
"2-6"
"lint, test, log, docs, data, pyspark, viz"

"example_pipeline":
"y"
Expand Down
6 changes: 2 additions & 4 deletions features/steps/cli_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def create_config_file_without_starter(context):
context.root_project_dir = context.temp_dir / context.project_name
context.package_name = context.project_name.replace("-", "_")
config = {
"tools": "1-5",
"tools": "lint, test, log, docs, data",
"project_name": context.project_name,
"example_pipeline": "no",
"repo_name": context.project_name,
Expand All @@ -189,14 +189,12 @@ def create_config_file_with_tools(context, tools):
It takes a custom tools list and sets example prompt to `y`.
"""

tools_str = tools if tools != "none" else ""

context.config_file = context.temp_dir / "config.yml"
context.project_name = "project-dummy"
context.root_project_dir = context.temp_dir / context.project_name
context.package_name = context.project_name.replace("-", "_")
config = {
"tools": tools_str,
"tools": tools,
"example_pipeline": "y",
"project_name": context.project_name,
"repo_name": context.project_name,
Expand Down
12 changes: 6 additions & 6 deletions features/tools.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Feature: New Kedro project with tools
Then I should get a successful exit code

Scenario: Create a new Kedro project with all tools except 'viz' and 'pyspark'
Given I have prepared a config file with tools "1,2,3,4,5"
Given I have prepared a config file with tools "lint, test, log, docs, data"
When I run a non-interactive kedro new without starter
Then the expected tool directories and files should be created with "1,2,3,4,5"
Then the expected tool directories and files should be created with "lint, test, log, docs, data"
Given I have installed the project dependencies
When I execute the kedro command "run"
Then I should get a successful exit code
Expand All @@ -25,17 +25,17 @@ Feature: New Kedro project with tools
Then I should get a successful exit code

Scenario: Create a new Kedro project with only 'pyspark' tool
Given I have prepared a config file with tools "6"
Given I have prepared a config file with tools "pyspark"
When I run a non-interactive kedro new without starter
Then the expected tool directories and files should be created with "6"
Then the expected tool directories and files should be created with "pyspark"
Given I have installed the project dependencies
When I execute the kedro command "run"
Then I should get a successful exit code

Scenario: Create a new Kedro project with only 'viz' tool
Given I have prepared a config file with tools "7"
Given I have prepared a config file with tools "viz"
When I run a non-interactive kedro new without starter
Then the expected tool directories and files should be created with "7"
Then the expected tool directories and files should be created with "viz"
Given I have installed the project dependencies
When I execute the kedro command "run"
Then I should get a successful exit code
Loading

0 comments on commit d6a78f4

Please sign in to comment.