Skip to main content

zsft.recipe.cmd

This recipe allows you to run arbitrary shell and python scripts from buildout. It’s inspired by similar recipes but has few added features.

Repository: https://github.com/zartsoft/zsft.recipe.cmd

To clone:

git clone https://github.com/zartsoft/zsft.recipe.cmd

Issue tracker: https://github.com/zartsoft/zsft.recipe.cmd/issues

Supported Python versions: 2.7, 3.3+

Supported zc.buildout versions: 1.x, 2.x.

Usage

install

Commands to execute on install phase.

update

Commands to execute on update phase.

shell

Shell to run script with. If not set uses default system shell. Special value internal means executing as python code from buildout.

install-shell

Can override shell for install phase.

update-shell

Can override shell for update phase.

shell-options

Additional switch to shell, like -File for PowerShell, -f for Awk, etc.

install-shell-options

Can override shell options for install phase.

update-shell-options

Can override shell options for update phase.

env

List of KEY=VALUE pairs to set environment variables.

Examples

[cmmi]
recipe = zsft.recipe.cmd
install =
    ./configure --prefix=${buildout:parts-directory}/opt
    make
    make install
env =
    CFLAGS = -g -Wall -O2
    LDFLAGS = -lm
    LD_RUN_PATH = $ORIGIN/../lib

[pythonscript]
recipe = zsft.recipe.cmd
shell = internal
install =
    os.chdir('${buildout:parts-directory}')
    if not os.path.exists('opt'):
        os.makedirs('opt')
    os.chdir('opt')
    check_call(['./config ; make'], shell=True)

[msbuild:windows]
recipe = zsft.recipe.cmd
configuration = Release
platform = Win32
install =
    msbuild.exe /t:Build /p:Configuration=${:configuration} /p:Platform=${:platform}

[service-restart:windows]
recipe = zsft.recipe.cmd
shell = powershell.exe
shell-options = -File
service = foo
update =
    $service = "${:service}"
    Write-Host -ForegroundColor Yellow "Restarting service '$service'"
    Restart-Service -Verbose $service

Difference from other recipes

Unlike other similar recipes this one allows you to specify custom shell on Windows and environment variables.

iw.recipe.cmd

Does not allow you to have different scripts for install and update. Specifying shell is POSIX only.

collective.recipe.cmd

Same limitations as in iw.recipe.cmd. Has uninstall_cmds and python mode.

plone.recipe.command

Has stop-on-error option and allows different scripts for install/update. Does not seem to allow multiline commands or custom shells.

Change history

0.4 (2017-06-21)

  • Fix environment parser

  • Fix conditional section syntax in example

  • Cleanup logging

0.3.1 (2017-06-21)

  • Fix shell options when no shell is passed.

0.3 (2017-06-21)

  • Run shell explicitly. Fixes running on POSIX.

0.2 (2017-06-20)

  • Fix for re-running install script.

0.1 (2017-06-20)

  • Initial release.

Metadata

Release files for zsft.recipe.cmd 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zsft.recipe.cmd 0.4
File Size Uploaded Provenance Actions
zsft.recipe.cmd-0.4.tar.gz 5.2 kB Without provenance Details for zsft.recipe.cmd-0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zsft.recipe.cmd 0.4
File Interpreter ABI Platform Actions
zsft.recipe.cmd-0.4-py2.py3-none-any.whl Python 3, Python 2 none any Details for zsft.recipe.cmd-0.4-py2.py3-none-any.whl

Total release size: 12.6 kB

Release files / zsft.recipe.cmd-0.4.tar.gz

Download URL zsft.recipe.cmd-0.4.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8813c88157ef612b92814d33a543b3c2028cb92dfb8ea5b4889352f2de26a1ff
BLAKE2b-256 checksum
How to use checksums
2a8ae4b565a9ba60b9ff807f6e7e7d74e10fc994fc0ead5a734376deac9dc0b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / zsft.recipe.cmd-0.4-py2.py3-none-any.whl

Download URL zsft.recipe.cmd-0.4-py2.py3-none-any.whl
Size 7.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
3b82553c73890ea3fc72be83eab788c2239cd6a43eccc546ffa7ad718aa400f0
BLAKE2b-256 checksum
How to use checksums
e4893e73ee8ed3858682dc9cb18fe9d00da268718ba3de1175f32dec289380ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for zsft.recipe.cmd 0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page