Skip to main content

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

Project description

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

Project details


Download files

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

Source Distribution

toolmaker-0.0.7.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

toolmaker-0.0.7-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file toolmaker-0.0.7.tar.gz.

File metadata

  • Download URL: toolmaker-0.0.7.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.1

File hashes

Hashes for toolmaker-0.0.7.tar.gz
Algorithm Hash digest
SHA256 05793d1483270c72c3e00909079eb1fd4e242fbcbc13bc6d70de07a6693bc35c
MD5 5db076ffac2b23e7f5c5e6d0eac6e950
BLAKE2b-256 71ec8862805f983c6896b186e8ac2e109fd12f6bc1be80a1d84d6c765ca400d9

See more details on using hashes here.

File details

Details for the file toolmaker-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: toolmaker-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.1

File hashes

Hashes for toolmaker-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 66eb9452a9c4f7b1f6f60500d3fcc2d95aa788e096f51544b62cb7bd4676b180
MD5 d99ae1421d9765b5b15f27e5ededc49d
BLAKE2b-256 fd3b94f4feb5c6babdc1be6231f36f64c5963e5de78eeeffa66f055ae4f91b51

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page