-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from kirillsulim/dev
Add simple how-to to README.md
- Loading branch information
Showing
2 changed files
with
55 additions
and
1 deletion.
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,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). |
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,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" | ||
|