diff options
| author | Roy Sommer <roy@sommer.co.il> | 2019-12-23 00:13:27 +0200 |
|---|---|---|
| committer | Roy Sommer <roy@sommer.co.il> | 2019-12-23 00:13:27 +0200 |
| commit | 4c6711a8d7e6d8aaecc0c6499f416dfea1ff3f6a (patch) | |
| tree | af4c524f908c394bcd13feb4f0b34270b8a6ec7b /README.md | |
| parent | v1.0.0 (diff) | |
| download | taskipy2-4c6711a8d7e6d8aaecc0c6499f416dfea1ff3f6a.zip | |
renaming
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -38,7 +38,7 @@ poetry add --dev taskipy ``` ### Adding Tasks -In your `pyproject.toml` file, add a new section called `[tool.taskify.tasks]`. +In your `pyproject.toml` file, add a new section called `[tool.taskipy.tasks]`. The section is a key-value map, from the names of the task to the actual command that should be run in the shell. @@ -46,7 +46,7 @@ Example: __pyproject.toml__ ```toml -[tool.taskify.tasks] +[tool.taskipy.tasks] test = "python -m unittest tests/test_*.py" lint = "pylint tests taskipy" ``` @@ -67,14 +67,14 @@ poetry run task test #### Grouping Subtasks Together Some tasks are composed of multiple subtasks. Instead of writing plain shell commands and stringing them together, you can break them down into multiple subtasks: ```toml -[tool.taskify.tasks] +[tool.taskipy.tasks] lint_pylint = "pylint tests taskipy" lint_mypy = "mypy tests taskipy" ``` And then create a composite task: ```toml -[tool.taskify.tasks] +[tool.taskipy.tasks] lint = "task lint_pylint && task lint_mypy" lint_pylint = "pylint tests taskipy" lint_mypy = "mypy tests taskipy" @@ -83,14 +83,14 @@ lint_mypy = "mypy tests taskipy" #### Pre Task Hook Tasks might also depend on one another. For example, tests might require some binaries to be built. Take the two following commands, for instance: ```toml -[tool.taskify.tasks] +[tool.taskipy.tasks] test = "python -m unittest tests/test_*.py" build = "make ." ``` You could make tests depend on building, by using the **pretask hook**: ```toml -[tool.taskify.tasks] +[tool.taskipy.tasks] pre_test = "task build" test = "python -m unittest tests/test_*.py" build = "make ." @@ -101,14 +101,14 @@ The pretask hook looks for `pre_<task_name>` task for a given `task_name`. It wi #### Post Task Hook From time to time, you might want to run a task in conjuction with another. For example, you might want to run linting after a successful test run. Take the two following commands, for instance: ```toml -[tool.taskify.tasks] +[tool.taskipy.tasks] test = "python -m unittest tests/test_*.py" lint = "pylint tests taskipy" ``` You could make tests trigger linting, by using the **posttask hook**: ```toml -[tool.taskify.tasks] +[tool.taskipy.tasks] test = "python -m unittest tests/test_*.py" post_test = "task lint" lint = "pylint tests taskipy" |