Skip to content

Commit

Permalink
Merge pull request #3 from kirillsulim/dev
Browse files Browse the repository at this point in the history
Add simple how-to to README.md
  • Loading branch information
kirillsulim authored Oct 21, 2022
2 parents 1dde99d + 346ddac commit 6cd0737
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,57 @@
# oak-build

A make-like build system written on python


## How to use

Create `oak_build.py` file in your project directory.
Every method marked with `@task` decorator can be called from CLI.

```python
from pathlib import Path

from oak_build import task


@task
def create_file():
with open(Path("result.txt"), "w") as txt:
txt.write("test content\n")
```

To execute `create_file` task call `oak create_file` from console.

## Task dependencies

You can link dependent tasks with `depends_on` parameter.

```python
from oak_build import task, run


@task
def unit_tests():
run("poetry run pytest tests")


@task
def integration_tests():
run("poetry run pytest integration_tests")


@task(
depends_on=[
unit_tests,
integration_tests,
]
)
def tests():
pass
```

When `oak tests` is called oak build will execute `unit_tests` and `integration_tests` tasks as well.

## Examples

For examples see [integration tests files](integration_tests/resources) and self build [oak_file.py](oak_file.py).
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "oak-build"
version = "0.1.1"
version = "0.1.1.post1"
description = ""
authors = ["Kirill Sulim <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 6cd0737

Please sign in to comment.