Skip to main content

Expose class members as Fabric tasks

Project description

Fabric has class-based tasks but they are limited: Task class represents a single task.

This module make it possible to have class-based Fabric task sets.


pip install fabric-taskset


TaskSet is a class that can expose its methods as Fabric tasks.


# my_lib/
from taskset import TaskSet, task

class SayBase(TaskSet):
    def say(self, what):
        raise NotImplemented()

    @task(default=True, alias='hi')
    def hello(self):

class EchoSay(SayBase):
    def say(self, what):
        local('echo ' + what)

instance = EchoSay()

from mylib import say

and then e.g.:

$ fab say.hi

taskset.task is a decorator declaring the wrapped method to be task. It acceps the same arguments as fabric.decorators.task so use it on methods just like fabric’s decorator is used on functions.

Acknowledgements is a very similar app. At the time of writing it is focused on old-style Fabric tasks and has a small deployment framework included.

In order to feed my NIH syndrome I create Fabric-taskset which exposes new-style Fabric tasks, provides slightly different API and doesn’t have extra goodies.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for fabric-taskset, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size fabric-taskset-0.1.tar.gz (3.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page