Skip to content
This repository has been archived by the owner on Jul 15, 2019. It is now read-only.
/ jaffle Public archive

Automation tool for Python software development including log formatting/filtering and interactive shell

License

Notifications You must be signed in to change notification settings

yatsu/jaffle

Repository files navigation

Jaffle

Build Status Documentation Status

This project was renamed from 'Turret' to 'Jaffle'.

Jaffle is an automation tool for Python software development, which has the following features:

  • Instantiate Python applications in a Jupyter kernel and allows them to interact each other
  • Launch external processes
  • Combine all log messages and allows filtering and reformatting by regular expressions and functions
  • Built-in WatchdogApp watches filesystem events and triggers another app, arbitrary code, and functions, which make it possible to setup various automations.

PyPI Project

jaffle · PyPI

Documentation

Jaffle documentation

Screenshot

tornado_spa example

Examples

They are included in examples directory.

This is an example of jaffle.hcl for auto-testing. You can run it by jaffle start.

kernel "py_kernel" {}

app "watchdog" {
  class  = "jaffle.app.watchdog.WatchdogApp"
  kernel = "py_kernel"

  options {
    handlers = [{
      patterns           = ["*.py"]
      ignore_directories = true
      code_blocks        = ["pytest.handle_watchdog_event({event})"]
    }]
  }
}

app "pytest" {
  class  = "jaffle.app.pytest.PyTestRunnerApp"
  kernel = "py_kernel"

  options {
    args = ["-s", "-v", "--color=yes"]

    auto_test = [
      "pytest_example/tests/test_*.py",
    ]

    auto_test_map {
      "pytest_example/**/*.py" = "pytest_example/tests/{}/test_{}.py"
    }
  }
}

Prerequisite

Jupyter Notebook and Tornado will be installed automatically if they do not exist in your environment. Tornado 5 is not yet supported.

Installation

$ pip install jaffle

You will also probably need pytest:

$ pip install pytest

License

BSD 3-Clause License

Warning

Jaffle is intended to be a development tool and does not care much about security. Arbitrary Python code can be executed in jaffle.hcl and you should not use it as a part of production environment. jaffle.hcl is like a Makefile or a shell script included in a source code repository.

Related Work

  • Watchdog
    • Python API and shell utilities to monitor file system events. Jaffle depends on it.
  • pytest-testmon
    • pytest plugin to select tests affected by recent changes. It looks code coverage to determine which tests should be executed, whereas Jaffle uses simple pattern mapping.
  • pytest-watch
    • Continuous pytest runner using Watchdog, which also supports notification, before/after hoooks and using a custom runner script. It executes pytest as a subprocess.
  • Foreman
    • Procfile-based process manager.
  • coloredlogcat.py and PID Cat
    • Android logcat modifier. Jaffle's log formatter was inspired by them.

About

Automation tool for Python software development including log formatting/filtering and interactive shell

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages