shrub.py
A python based Evergreen project config generation library
Overview
Based on shrub, shrub.py is a library for programatically building Evergreen project configurations described here.
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.v3.evg_task import EvgTask, EvgTaskDependency
from shrub.v3.evg_build_variant import BuildVariant, DisplayTask
from shrub.v3.evg_command import FunctionCall
from shrub.v3.evg_project import EvgProject
from shrub.v3.shrub_service import ShrubService
n_tasks = 10
def define_task(index):
name = f"task_name_{index}"
return EvgTask(
name=name,
commands=[
FunctionCall(func="do setup"),
FunctionCall(
func="run test generator",
vars={"parameter_1": "value 1", "parameter_2": "value 2"}
),
FunctionCall(func="run tests")
],
depends_on=[EvgTaskDependency(name="compile")]
)
tasks = [define_task(i) for i in range(n_tasks)]
display_task = DisplayTask(name="test_suite", execution_tasks=[t.name for t in tasks])
variant = BuildVariant(name="linux-64", tasks=[], display_tasks=[display_task])
project = EvgProject(buildvariants=[variant], tasks=tasks)
print(ShrubService.generate_json(project))
Run tests
poetry run pytest
Metadata
Release files for shrub.py 3.11.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| shrub_py-3.11.0.tar.gz | 33.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| shrub_py-3.11.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 74.6 kB
Release files / shrub_py-3.11.0.tar.gz
| Download URL | shrub_py-3.11.0.tar.gz |
|---|---|
| Size | 33.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1a8e848626d87e06447359dc1dcd9b260b598fa4fc71aad62dd3657de3cb92c
|
|
BLAKE2b-256 checksum How to use checksums |
ddd0530e0fb93be84b1c2d4d0917ac2e220cd79801759ea38ec90c2073872842
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.9.2 Linux/5.15.0-1021-aws
|
Release files / shrub_py-3.11.0-py3-none-any.whl
| Download URL | shrub_py-3.11.0-py3-none-any.whl |
|---|---|
| Size | 40.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
91b11a268ce80fbe6e12b61db4b240b8744005de40feafe0b3c112c630505aa4
|
|
BLAKE2b-256 checksum How to use checksums |
0e9c46f27da57a4ebeed2b923eebaf0763a233ec4e991478d5404b924aecbf9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.9.2 Linux/5.15.0-1021-aws
|