Metadata-Version: 2.1
Name: detox-jar
Version: 1.1.0
Summary: Command line automation tool in pure Python
Author-email: Kaloyan Ivanov <kaloyan.ivanov88@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Kaloyan Ivanov
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: repository, https://github.com/kaliv0/detox-jar.git
Keywords: automation,cli tool,command line runner
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyyaml>=6.0.2
Provides-Extra: dev
Requires-Dist: ruff>=0.7.3; extra == "dev"
Requires-Dist: build>=1.2.2; extra == "dev"
Requires-Dist: twine>=5.1.1; extra == "dev"

<p align="center">
  <img src="https://github.com/kaliv0/detox-jar/blob/main/assets/detox-jar.jpg?raw=true" width="250" alt="Detox jar">
</p>

# Detox jar

![Python 3.x](https://img.shields.io/badge/python-3.11-blue?style=flat-square&logo=Python&logoColor=white)
[![PyPI](https://img.shields.io/pypi/v/detox-jar.svg)](https://pypi.org/project/detox-jar/)
[![Downloads](https://static.pepy.tech/badge/detox-jar)](https://pepy.tech/projects/detox-jar)

<br>Command line automation tool in pure Python

---------------------------
### How to use
- Describe jobs as tables/dictionaries in a config file called 'detox' (choose between .toml, .yaml or .json format).
<br>(Put the config inside the root directory of your project)
```toml
# detox.toml
[test]
description = "test project"
dependencies = ["pytest", "pytest-cov"]
commands = "pytest -vv --disable-warnings -s --cache-clear"
```
```yaml
# detox.yaml
test:
  description: test project
  dependencies:
    - pytest
    - pytest-cov
  commands:
    - pytest -vv --disable-warnings -s --cache-clear
```

- <i>description</i> and <i>dependencies</i> could be optional but not <i>commands</i>
```toml
# detox.toml
[no-deps]
commands = "echo 'Hello world'"
```
(in json)
```json
"no-deps": {
  "commands": "echo 'Hello world'"
}
```

- <i>dependencies</i> and <i>commands</i> could be strings or (in case of more than one) a list of strings
```toml
# detox.toml
commands = ["ruff check --fix", "ruff format --line-length=100 ."]
```
```yaml
# detox.yaml
commands:
  - ruff check --fix
  - ruff format --line-length=100 .
```

- You could provide a [run] table inside the config file with a <i>'suite'</i> - list of selected jobs to run
```toml
[run]
suite = ["lint", "format", "test"]
```
```json
"run": {
  "suite": [
    "lint",
    "format",
    "test",
    "no-deps"
  ]
}
```
---------------------------
- Run the tool in the terminal with a simple <b>'detox'</b> command
```shell
$ detox
```
```shell
(logs omitted...)
$ All jobs succeeded! ['lint', 'format', 'test']
Detoxing took: 14.088007061000098
```
- In case of failing jobs you get general stats
```shell
(logs omitted...)
$ Unsuccessful detoxing took: 13.532951637999759
Failed jobs: ['format']
Successful jobs: ['lint', 'test']
```
or
```shell
$ Unsuccessful detoxing took: 8.48367640699962
Failed jobs: ['format']
Successful jobs: ['lint']
Skipped jobs: ['test']
```
---------------------------
- You could run specific jobs in the command line
```shell
$ detox -j lint
```
or a list of jobs
```shell
$ detox -j lint format
```
<b>NB:</b> If there is a <i>'run'</i> table in the config file the jobs specified in the command line take precedence
