Skip to main content

Run lightweight local workflows

Project description

Dyngle

Run lightweight local workflows

Dyngle is a simple workflow runner that executes sequences of commands defined in configuration files. It's like a lightweight combination of Make and a task runner, designed for automating common development and operational tasks.

Basic usage

Create a configuration file (e.g., .dyngle.yml) with your workflows:

dyngle:
  operations:
    build:
      - python -m pip install -e .
      - python -m pytest
    deploy:
      - docker build -t myapp .
      - docker push myapp
    clean:
      - rm -rf __pycache__
      - rm -rf .pytest_cache

Run an operation:

dyngle run build

Configuration

Dyngle reads configuration from YAML files. You can specify the config file location using:

  • --config command line option
  • DYNGLE_CONFIG environment variable
  • .dyngle.yml in current directory
  • ~/.dyngle.yml in home directory

Workflow structure

Each operation is defined as a list of tasks under dyngle.operations. Tasks are executed sequentially using Python's subprocess module for security.

Example with multiple operations:

dyngle:
  operations:
    test:
      - python -m unittest discover
      - python -m coverage report
    docs:
      - sphinx-build docs docs/_build
      - open docs/_build/index.html
    setup:
      - python -m venv venv
      - source venv/bin/activate
      - pip install -r requirements.txt

Expressions

Configs can also contain expressions.

dyngle:
  expressions:
    say-hello: >-
        'Hello ' + name + '!'
  operations:
    say-hello: echo {{say-hello}}

Expressions can use a controlled subset of the Python standard library, including:

  • Built-in data types such as str()
  • Essential built-in functions such as len()
  • The core modules from the datetime package (but some methods such as strftime() will fail)
  • A specialized function called formatted() to perform string formatting operations on a datetime object
  • A restricted version of Path() that only operates within the current working directory

Security

Commands are executed using Python's subprocess.run() with arguments split in a shell-like fashion. The shell is not used, which reduces the likelihood of shell injection attacks. However, note that Dyngle is not robust to malicious configuration.

Quick installation (MacOS)

brew install python@3.11
python3.11 -m pip install pipx
pipx install dyngle

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

dyngle-0.4.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dyngle-0.4.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file dyngle-0.4.0.tar.gz.

File metadata

  • Download URL: dyngle-0.4.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for dyngle-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7f7a312adf4931785ee5d9e69d23cfd8e3079d17faeda4ba5ed3ca5778001e8a
MD5 fa6330380aefdcf85fb4d6e975abeb67
BLAKE2b-256 cc104e1535231406ce9691620b117704dfc33ea93c75b3d59c65bb2b3576c8c8

See more details on using hashes here.

File details

Details for the file dyngle-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: dyngle-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for dyngle-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fcb08f25ad623f78f1085eee7f08dc9cd7b554c133bba484f2ef2adb8198b3cc
MD5 b1c447ab7a5d67a800a476ffc079b4dc
BLAKE2b-256 81500293f27b31c9ed74102e36e274d3447070e59557432fdb12e010159858c9

See more details on using hashes here.

Supported by

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