Fabric Tasks
Sublime Text plugin for running tasks Fabric / Python
Details
Installs
- Total 1K
- Win 365
- Mac 482
- Linux 336
| Dec 2 | Dec 1 | Nov 30 | Nov 29 | Nov 28 | Nov 27 | Nov 26 | Nov 25 | Nov 24 | Nov 23 | Nov 22 | Nov 21 | Nov 20 | Nov 19 | Nov 18 | Nov 17 | Nov 16 | Nov 15 | Nov 14 | Nov 13 | Nov 12 | Nov 11 | Nov 10 | Nov 9 | Nov 8 | Nov 7 | Nov 6 | Nov 5 | Nov 4 | Nov 3 | Nov 2 | Nov 1 | Oct 31 | Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
| Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Sublime Fabric
Run your Fabric tasks without leaving Sublime Text.
Sublime Fabric finds the fabfile.py files in your project, lists their tasks
in the Command Palette and runs the one you pick, with its output in a new tab.
Fabric: Execute Task
Features
- Lists the tasks of every
fabfile.pyin the open folders, including tasks of sub-collections (docs.build-docs). - Works with Fabric 2 and 3, and with Fabric 1 (including the
Fabric3fork). The version is detected fromfab --version. - Passes arguments to tasks.
- Uses the
fabof your project's virtualenv automatically, or the one you choose in the settings. - Shows the output while the task runs. Closing the tab stops the task.
- A fabfile that fails to load doesn't hide the tasks of the others.
Installation
Package Control
- Install Package Control if you don't have it yet.
- Open the Command Palette (
Ctrl+Shift+P, orCmd+Shift+Pon macOS) and run Package Control: Install Package. - Search for Fabric Tasks and install it.
Manually
Clone the repository into your Packages folder (Preferences → Browse
Packages…), in a folder named Fabric Tasks:
git clone https://github.com/b3ni/Sublime-Fabric.git "Fabric Tasks"
Usage
Open the Command Palette and run one of these commands:
| Command | What it does |
|---|---|
| Fabric: Execute Task | Lists the tasks of the project and runs the one you pick. |
| Fabric: Execute Task with Arguments | Same, then asks for the task's arguments. |
| Preferences: Fabric Settings | Opens the default and user settings side by side. |
Passing arguments
After choosing a task with Fabric: Execute Task with Arguments, type its arguments in the panel. It remembers the last arguments used for each task until Sublime Text is closed. The syntax depends on your Fabric version:
| Fabric | Syntax | Example |
|---|---|---|
| 2 and 3 | As on the command line, after the task name | --name=Ana or --name "Ana María" |
| 1 | As after task: on the command line |
Ana or name=Ana,greeting=hi |
With Fabric 2 and 3, parameters without a default value can also be given by
position: Ana.
Key binding
The commands have no default key binding. To add one, open Preferences → Key Bindings and add, for example:
{ "keys": ["ctrl+alt+f"], "command": "fab_tasks", "args": {"ask_arguments": true} }
Leave out "args" to run tasks without asking for arguments.
Settings
| Setting | Default | Description |
|---|---|---|
fab_path |
"" |
The fab executable to use. It can be an absolute path (/usr/local/bin/fab, ~/.venvs/deploy/bin/fab), a path relative to the first project folder (.venv/bin/fab) or a command name looked up on the PATH. |
search_virtualenv |
true |
When fab_path is empty, look for fab in a .venv, venv, env or .env folder at the top level of each project folder. |
When fab_path is empty, Sublime Fabric uses the first fab it finds in this
order:
- A virtualenv at the top level of a project folder (if
search_virtualenvis on). Afabwhose Python interpreter doesn't exist on this machine, for example one from a virtualenv created inside a VM, is skipped. fabon thePATH.
Per-project settings
To change a setting for one project only, add it with a fabric_ prefix to the
settings section of the .sublime-project file:
{
"folders": [{"path": "."}],
"settings": {
"fabric_fab_path": "~/.venvs/deploy/bin/fab"
}
}
Troubleshooting
Error Fabric: could not run "fab". Sublime Text can't find the fab executable.
Set fab_path to the full path printed by which fab (where fab on Windows).
A task works in the terminal but not in Sublime Text. Sublime Text was
probably started with a different PATH (this is common when it's opened from
the macOS Dock or the Windows Start menu) and is running another fab or
another Python. Set fab_path to the same fab you use in the terminal.
Tasks run from the folder that contains their fabfile.py, so relative paths
in the fabfile are resolved as when you run fab from that folder.
A fabfile is missing from the list. Its full error is printed in the Sublime Text console (View → Show Console).
Contributing
Bug reports and suggestions are welcome in the issue tracker, and pull requests too. Thanks to everyone who has contributed.
License
MIT © Benito Rodríguez Arcos