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-2/

Build System CLI

A command-line tool for managing build and deployment tasks.

Requirements

Build a CLI tool with the following commands:

Build Command

Create a build command that:

  • Accepts a project name as a required input
  • Has a --clean boolean flag to clean before building (defaults to False)
  • Has a --verbose flag that can be repeated to increase verbosity level (e.g., -v, -vv, -vvv for levels 1, 2, 3)
  • Has an --output-dir option to specify where to place build artifacts (defaults to "build")
  • Prints the project name, verbosity level, whether clean was requested, and the output directory

Deploy Command

Create a deploy command that:

  • Accepts an environment name (e.g., "staging" or "production") as a required input
  • Has a --skip-tests boolean flag to skip running tests before deployment
  • Has a --tag flag that can be specified multiple times to add deployment tags
  • Prints the environment, whether tests are skipped, and all tags provided

Test Cases

  • Running invoke build myproject --clean -vv --output-dir dist should print: project=myproject, clean=True, verbose=2, output_dir=dist @test

  • Running invoke deploy production --tag v1.0.0 --tag stable --skip-tests should print: environment=production, skip_tests=True, tags=['v1.0.0', 'stable'] @test

  • Running invoke build myapp should print: project=myapp, clean=False, verbose=0, output_dir=build @test

Implementation

@generates

API

from invoke import task

@task
def build(c, project, clean=False, verbose=0, output_dir='build'):
    """Build a project with various options."""
    pass

@task
def deploy(c, environment, skip_tests=False, tag=None):
    """Deploy to an environment with optional tags."""
    pass

Dependencies { .dependencies }

invoke { .dependency }

Provides task execution and CLI generation capabilities.