or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/invoke@2.2.x
tile.json

tessl/pypi-invoke

tessl install tessl/pypi-invoke@2.2.0

Pythonic task execution library for managing shell-oriented subprocesses and organizing executable Python code into CLI-invokable tasks

Agent Success

Agent success rate when using this tile

96%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.25x

Baseline

Agent success rate without this tile

77%

task.mdevals/scenario-8/

Custom Task Logger

Build a task automation system that tracks and logs task executions with timestamps and execution metadata.

Requirements

Create a custom task that automatically logs when it starts and completes execution, including the timestamp and any relevant metadata. The system should:

  1. Define a custom task class that extends the base task functionality to add automatic execution logging
  2. Implement tasks using this custom task class
  3. Log the task name, start time, end time, and execution duration to a file
  4. Support the standard task decorator parameters and behavior

Implementation

@generates

Test Cases

  • When the build task is invoked, a log entry is written to 'task_log.txt' containing the task name "build", start timestamp, end timestamp, and execution duration @test
  • When both build and test tasks are invoked sequentially, 'task_log.txt' contains two separate log entries with correct task names and timestamps @test
  • The custom task class preserves the docstring as help text when running with --help @test

API

from invoke import Task

class LoggingTask(Task):
    """
    Custom task class that logs execution metadata to 'task_log.txt'.

    Logs task name, start timestamp, end timestamp, and execution duration.
    """
    pass


def build(c):
    """Build the project."""
    pass


def test(c):
    """Run tests."""
    pass

Dependencies { .dependencies }

invoke { .dependency }

Provides task automation and execution framework with support for custom task classes via the klass parameter.

@satisfied-by