Skip to main content

WoSIT is an automation tool made to replace **make** in many instances.

Project description

WoSIT (Workflow Script Interpreter Tool)

WoSIT is an automation tool made to replace make in many instances. It is written in pure Python and is built to ease integration of other Python scripts in automation workflows. This repository uses mainly WoSIT (building applications, generating configurations, tests automation, ...), except some legacy code still making use of make and Makefiles.

Much like make makes use of Makefiles, WoSIT automation workflow is based around files describing the tasks to execute called buildconfig.py. Those are Python files, and as such allow for the use of the full scripting capabilities offered by Python and its packages. This fact makes it closer to generating automation workflows based on the given script, compared to make which uses workflows descriptions.

Using WoSIT

Similarly to Makefiles, WoSIT's way of describing automation workflows is through buildconfig.py files.

Basic Usage

Executing a WoSIT workflow is as simple as typing wosit in a directory where a buildconfig.py file is present. By default WoSIT will execute the all rule.

Similarly to Make, parallel execution can be achieved with the -j flag followed by the maximum number of processes to use.

Basic Example

The following script defines a Python function named genMyRules() to generate a number of rules. Each rule depends on the previous one, and will use the shell echo command to print its own id in the terminal. The script then generates those rules by calling the function.

The rule with target all is added with its source set to the last generated rule. This target is special as it is executed by default when no other target is specified.

from wosit.wosit import *

def genMyRules(nbrules):
    addRule(
        target = f"rule_0",
        command = f"echo This is a rule with id 0"
    )
    for i in range(1, nbrules):
        addRule(
            target = f"rule_{i}",
            source = f"rule_{i-1}",
            command = f"echo This is a rule with id {i}"
        )

nb_rules = 10
genMyRules(nb_rules)

addRule(
    target = "all",
    source = f"rule_{nb_rules-1}"
)

addRule(
    target="clean",
    command=f"""
    echo Clean commands should go here.
    """
)

Python Functions Example

WoSIT is capable of executing Python functions. The syntax is the same as any other rule, with the exception that the function must be passed to the command argument through WoSIT's Function() object.

from wosit.wosit import *

addRule(
    target = "rule_0",
    command = Function(print, args=("This is rule 0.",))
)

addRule(
    target = "rule_1",
    command = Function(print, args=("This is rule 1.",))
)


addRule(
    target = "all",
    source = ["rule_0", "rule_1"]
)

More Examples

More examples are available in the examples folder of this repository.

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

wosit-0.2.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

wosit-0.2.1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file wosit-0.2.1.tar.gz.

File metadata

  • Download URL: wosit-0.2.1.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wosit-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7acd0645d13cc881f8a7f76c3237446e332969582182706deb65d41a47e3b6f1
MD5 f6cf1d6f5af6deb112f388f2d652f843
BLAKE2b-256 24404ab07b45d74fd17ff2842a439dfe53288a032577ba3b0915fc12a014cb53

See more details on using hashes here.

Provenance

The following attestation bundles were made for wosit-0.2.1.tar.gz:

Publisher: python-publish.yml on mgraschevalier/WoSIT

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wosit-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: wosit-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wosit-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 061cc496418efc84aac46dced360beeaada9999d284dfc065451189a2255261a
MD5 4e7efe98c0d4f3314c4c54a3c0cfc440
BLAKE2b-256 84360c52ff6ebd0d618729f1fba799d15d60badb533c2bd2de0c2bf3edb03408

See more details on using hashes here.

Provenance

The following attestation bundles were made for wosit-0.2.1-py3-none-any.whl:

Publisher: python-publish.yml on mgraschevalier/WoSIT

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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