Library for creating evergreen configurations
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shrub_py-3.10.0.tar.gz.
File metadata
- Download URL: shrub_py-3.10.0.tar.gz
- Upload date:
- Size: 33.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.9.2 Linux/5.15.0-1021-aws
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
035cb81fabbd72f47792ab4304ce33af262005842fa5886c1e57b7a2a9d53cfa
|
|
| MD5 |
4e3723da7ea1236efcbdc0f0c61e2ebf
|
|
| BLAKE2b-256 |
76096b6528a84471d432c37ecfb48fd3987cf9b02bba6bca5ef8a406b66822c5
|
File details
Details for the file shrub_py-3.10.0-py3-none-any.whl.
File metadata
- Download URL: shrub_py-3.10.0-py3-none-any.whl
- Upload date:
- Size: 40.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.9.2 Linux/5.15.0-1021-aws
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
239ad492819c84f14f4349d3679f5a6218468441861f310a2320ec9683862805
|
|
| MD5 |
c4e8ca2c406cc89f7371c14f5fc3e289
|
|
| BLAKE2b-256 |
1f080f1d5a935de84c74239b8337c6e215fa8e75c3eb9733c68e9bef88ae9052
|