Metadata-Version: 2.1
Name: shrub.py
Version: 3.0.3
Summary: Library for creating evergreen configurations
Home-page: https://github.com/evergreen-ci/shrub.py
License: Apache-2.0
Author: David Bradford
Author-email: david.bradford@mongodb.com
Requires-Python: >3.6.1
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: PyYaml (>=5.1,<6.0)
Requires-Dist: dataclasses (>=0.7,<0.8); python_full_version >= "3.6.0" and python_full_version < "3.7.0"
Requires-Dist: git-url-parse (>=1,<2)
Requires-Dist: pydantic (>=1.8,<2.0)
Requires-Dist: typing-extensions (>=4,<5)
Project-URL: Repository, https://github.com/evergreen-ci/shrub.py
Description-Content-Type: text/markdown

# shrub.py

A python based Evergreen project config generation library

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/shrub.py)
[![PyPI version](https://badge.fury.io/py/shrub.py.svg)](https://pypi.org/project/shrub.py/)

## Overview

Based on [shrub](https://github.com/evergreen-ci/shrub/), shrub.py is a library for programatically
building Evergreen project configurations described [here](https://github.com/evergreen-ci/evergreen/wiki/Project-Files).

## Example

The following snippet will create a set of parallel tasks reported under a single display task. It
would generate json used by ```generate.tasks```:

```
from shrub.v2 import ShrubProject, Task, BuildVariant

n_tasks = 10
def define_task(index):
    name = f"task_name_{index}"

    return Task(
        name,
        [
            FunctionCall("do setup"),
            FunctionCall(
                "run test generator",
                {"parameter_1": "value 1", "parameter_2": "value 2"}
            ),
            FunctionCall("run tests")
        ],
    ).dependency("compile")

tasks = {define_task(i) for i in range(n_tasks)}
variant = BuildVariant("linux-64").display_task("test_suite", tasks)
project = ShrubProject({variant})

project.json()
```

## Run tests

```
poetry run pytest
```

