Giter VIP home page Giter VIP logo

toolmaker's Introduction

Introduction

Make single-file builds of Python tools using zapp, shiv, or pex.

Repositories

Binary distributions:

Source code:

Usage

$ toolmaker --help
usage: toolmaker [-h] [--version] [--config CONFIG]
                 [--build | --rebuild | --delete] [--all]
                 [tool [tool ...]]

Make single-file builds of Python tools using zapp, shiv, or pex

positional arguments:
  tool                  apply action on this tool(s)

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --config CONFIG, -c CONFIG
                        configuration file (default:
                        /home/sinoroc/.config/toolmaker/toolmaker.cfg)
  --build, -b           build selected tool(s)
  --rebuild, -r         rebuild selected tool(s)
  --delete, -d          delete selected tool(s)
  --all, -a             apply action on all tools

Configuration

By default this tool looks for a configuration file at the following location:

  • ${HOME}/.config/toolmaker/toolmaker.cfg on Linux
  • %USERPROFILE%\AppData\Roaming\toolmaker\toolmaker.cfg on Windows
[toolmaker.tool.defaults]
tools_directory = ~/.local/bin/.toolmaker

[toolmaker.tool.zapp:deptree]
entry_point = deptree.cli:main
requirements =
    deptree

[toolmaker.tool.pex:http]
entry_point = http.server

[toolmaker.tool.shiv:shiv]
entry_point = shiv.cli:main
requirements =
    shiv

[toolmaker.tool.zapp:something]
entry_point = something.cli:main
requirements =
    --no-index
    SomeRandomProject --find-links /path/to/location
requirements_txts =
    requirements.txt
    more.txt

Action

The action can be specified on the command line. Either one of:

  • --build, -b to build (already existing tools are skipped);
  • --rebuild, -r to rebuild (already existing tools are rebuilt);
  • --delete, -d to delete (tool target file is deleted if it exists, then its parent directory is deleted if it is empty).

The default action when no flag is specified is to build the tools.

Configuration

Place tools in current directory

[toolmaker.tool.defaults]
tools_directory =
tool_directory =

[toolmaker.tool.zapp:foo]
# ./foo

[toolmaker.tool.zapp:bar]
# ./bar

Place tools in specific directory

[toolmaker.tool.defaults]
tools_directory = /somewhere
tool_directory =

[toolmaker.tool.zapp:foo]
# /somewhere/foo

[toolmaker.tool.zapp:bar]
# /somewhere/bar

Place tools in subdirectories

[toolmaker.tool.defaults]
tools_directory = /somewhere

[toolmaker.tool.zapp:foo0]
# /somewhere/foo0/foo0

[toolmaker.tool.zapp:foo1]
tool_directory = foo0
# /somewhere/foo0/foo1

[toolmaker.tool.zapp:foo2]
# /somewhere/foo2/foo2

[toolmaker.tool.zapp:foo3]
tool_file = foo0
# /somewhere/foo3/foo0

Example to use with GNU stow

To use in combination with GNU Stow:

[toolmaker.tool.defaults]
tools_directory = ~/.local/bin/.toolmaker

[toolmaker.tool.zapp:foo0]
# ~/.local/bin/.toolmaker/foo0/foo0

[toolmaker.tool.zapp:foo1]
tool_directory = foo0
# ~/.local/bin/.toolmaker/foo0/foo1

[toolmaker.tool.zapp:foo2]
# ~/.local/bin/.toolmaker/foo2/foo2

[toolmaker.tool.zapp:foo3]
tool_file = foo0
# ~/.local/bin/.toolmaker/foo3/foo0

Details

Similar projects

toolmaker's People

Contributors

sinoroc avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

toolmaker's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.