kumade


Namekumade JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
SummaryA make-like build utility for Python.
upload_time2024-10-21 01:00:56
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseMIT License
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # kumade

A make-like build utility for Python.

Features:

- You can define tasks, such as executing commands, creating files,
  or invoking functions, in `Kumadefile.py`, with standard Python code.
- You can run tasks from shell with `kumade` command.
- Any task can have its dependencies and kumade considers the dependency graph
  to determin the task execution order.
- Kumade decides whether or not to perform a file creation task with considering
  the file existence and whether its timestamp is older than its dependencies.

*Kumade* means rake in Japanese, and it is regarded as a lucky charm
because it collects happiness.


## Getting started

### Install

To install kumade, use pip:

```console
pip install kumade
```

### Write `Kumadefile.py`

To define tasks, write `Kumadefile.py`.

For example,

```python
import kumade as ku

from pathlib import Path
import subprocess

ku.set_default("greet")

help_file = Path("help.txt")

@ku.task("greet")
@ku.depend(help_file)
def greeting() -> None:
    print("Hi, this is Kumade.")
    print(f"See {help_file}.")

@ku.file(help_file)
def create_help_file() -> None:
    with help_file.open("w") as outfile:
        subprocess.run(["kumade", "-h"], stdout=outfile)
```

This example defines two tasks and sets default task.

The task "greet" is defined by the decorator `@ku.task("greet")`
and it will output a greeting when executed.
This task depends on the file "help.txt" and
kumade will execute the file creation task if it does not exist.

The file creation task for "help.txt" is defined by the decorator
`@ku.file(help_file)` and it will create the file by capturing
the standard output of command execution.

You can see more examples of task definition in the file
[Kumadefile.py](https://github.com/yamaimo/kumade/blob/main/Kumadefile.py)
in the [kumade](https://github.com/yamaimo/kumade) repository.

### Run

To run tasks from shell, use `kumade` command:

```console
kumade
```

`kumade` command loads task definitions from `Kumadefile.py` and
runs the specified tasks (or the default task if no task is specified).

Run `kumade --help` to see available options.


## For development

### Install

You can install this package from GitHub directly:

```console
pip install git+ssh://git@github.com/yamaimo/kumade.git
```

Or, to develop, install from a cloned repository as follows:

```console
# clone repository
git clone git@github.com:yamaimo/kumade.git
cd kumade

# create venv and activate it
python3.11 -m venv venv
source venv/bin/activate

# install this package as editable with dependencies
pip install -e .[develop]
```

### Format and Lint

To format, execute `kumade format`.

To lint, execute `kumade lint`.

### Unit test

To run unit test, execute `kumade test`.

If you want verbose output, execute `kumade test_verbose=true test`.

If you want to run each test file, execute `kumade test_each=true path/to/test_file.py`

### Coverage

To measure coverage and report it, execute `kumade coverage`.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "kumade",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "yamaimo <hello@yamaimo.dev>",
    "download_url": "https://files.pythonhosted.org/packages/68/c5/875fbeedaf34318129a2e1ccfd30150cedd474f1c8b4ed33dfbc9b1d01c0/kumade-0.2.0.tar.gz",
    "platform": null,
    "description": "# kumade\n\nA make-like build utility for Python.\n\nFeatures:\n\n- You can define tasks, such as executing commands, creating files,\n  or invoking functions, in `Kumadefile.py`, with standard Python code.\n- You can run tasks from shell with `kumade` command.\n- Any task can have its dependencies and kumade considers the dependency graph\n  to determin the task execution order.\n- Kumade decides whether or not to perform a file creation task with considering\n  the file existence and whether its timestamp is older than its dependencies.\n\n*Kumade* means rake in Japanese, and it is regarded as a lucky charm\nbecause it collects happiness.\n\n\n## Getting started\n\n### Install\n\nTo install kumade, use pip:\n\n```console\npip install kumade\n```\n\n### Write `Kumadefile.py`\n\nTo define tasks, write `Kumadefile.py`.\n\nFor example,\n\n```python\nimport kumade as ku\n\nfrom pathlib import Path\nimport subprocess\n\nku.set_default(\"greet\")\n\nhelp_file = Path(\"help.txt\")\n\n@ku.task(\"greet\")\n@ku.depend(help_file)\ndef greeting() -> None:\n    print(\"Hi, this is Kumade.\")\n    print(f\"See {help_file}.\")\n\n@ku.file(help_file)\ndef create_help_file() -> None:\n    with help_file.open(\"w\") as outfile:\n        subprocess.run([\"kumade\", \"-h\"], stdout=outfile)\n```\n\nThis example defines two tasks and sets default task.\n\nThe task \"greet\" is defined by the decorator `@ku.task(\"greet\")`\nand it will output a greeting when executed.\nThis task depends on the file \"help.txt\" and\nkumade will execute the file creation task if it does not exist.\n\nThe file creation task for \"help.txt\" is defined by the decorator\n`@ku.file(help_file)` and it will create the file by capturing\nthe standard output of command execution.\n\nYou can see more examples of task definition in the file\n[Kumadefile.py](https://github.com/yamaimo/kumade/blob/main/Kumadefile.py)\nin the [kumade](https://github.com/yamaimo/kumade) repository.\n\n### Run\n\nTo run tasks from shell, use `kumade` command:\n\n```console\nkumade\n```\n\n`kumade` command loads task definitions from `Kumadefile.py` and\nruns the specified tasks (or the default task if no task is specified).\n\nRun `kumade --help` to see available options.\n\n\n## For development\n\n### Install\n\nYou can install this package from GitHub directly:\n\n```console\npip install git+ssh://git@github.com/yamaimo/kumade.git\n```\n\nOr, to develop, install from a cloned repository as follows:\n\n```console\n# clone repository\ngit clone git@github.com:yamaimo/kumade.git\ncd kumade\n\n# create venv and activate it\npython3.11 -m venv venv\nsource venv/bin/activate\n\n# install this package as editable with dependencies\npip install -e .[develop]\n```\n\n### Format and Lint\n\nTo format, execute `kumade format`.\n\nTo lint, execute `kumade lint`.\n\n### Unit test\n\nTo run unit test, execute `kumade test`.\n\nIf you want verbose output, execute `kumade test_verbose=true test`.\n\nIf you want to run each test file, execute `kumade test_each=true path/to/test_file.py`\n\n### Coverage\n\nTo measure coverage and report it, execute `kumade coverage`.\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "A make-like build utility for Python.",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/yamaimo/kumade"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c07ba2b52164adf3a412867e71c02abab0c67ac48978431a55dc1c03b12cd9b2",
                "md5": "e39a89508ef12443d22983a86e0835d0",
                "sha256": "4d24b02de9fe237f5118a045d87e12ebf75637479d53a651a2159dff28a8f817"
            },
            "downloads": -1,
            "filename": "kumade-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e39a89508ef12443d22983a86e0835d0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 13680,
            "upload_time": "2024-10-21T01:00:54",
            "upload_time_iso_8601": "2024-10-21T01:00:54.428910Z",
            "url": "https://files.pythonhosted.org/packages/c0/7b/a2b52164adf3a412867e71c02abab0c67ac48978431a55dc1c03b12cd9b2/kumade-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "68c5875fbeedaf34318129a2e1ccfd30150cedd474f1c8b4ed33dfbc9b1d01c0",
                "md5": "bcac65b8813e22cd56535b12433ecea0",
                "sha256": "da1fba4c49d05627383bbfebb880975a0c0f3f57f44aa8f3458e57a8d13886c9"
            },
            "downloads": -1,
            "filename": "kumade-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "bcac65b8813e22cd56535b12433ecea0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 16940,
            "upload_time": "2024-10-21T01:00:56",
            "upload_time_iso_8601": "2024-10-21T01:00:56.180418Z",
            "url": "https://files.pythonhosted.org/packages/68/c5/875fbeedaf34318129a2e1ccfd30150cedd474f1c8b4ed33dfbc9b1d01c0/kumade-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-21 01:00:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yamaimo",
    "github_project": "kumade",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "kumade"
}
        
Elapsed time: 0.76472s