Table of Contents
UVengine
Universal Variability resolution engine for UVL models and text-based artifacts with Jinja templates.
Official website
Description
UVengine is a variability resolution engine for UVL models and text-based artifacts with Jinja templates.
Its main features are:
- A variability resolution engine for UVL models.
- Support all language level extensions of UVL.
- Feature traceability between UVL models and implementation artifacts.
- Language independence for any text-based artifacts using Jinja templates.
- Composition and annotation-based mechanisms to implement variability at different degrees of granularity.
- Easy integration with existing tools of the UVL ecosystem such as UVLS and flamapy.
How to use it
The tool is currently deployed and available online in the following link so that you don't need to install any stuff:
The main use case of the tool is uploading the files and it automatically resolves the variability.
- Inputs:
- The feature model (.uvl).
- A configuration of the feature model (.json).
- The templates artifacts (.jinja)
- A mapping model (optional) to relate the features in the feature model within the variation points in the artifacts.
- Outputs:
- The artifacts with their variability resolved.
Video demo
Using the library
In case you want to use UVengine programatically as a library or using CLI.
Requirements
Download and install
-
Install Python 3.9+
-
Clone this repository and enter into the main directory:
git clone https://github.com/UVengine/uvenginecd uvengine -
Create a virtual environment:
python -m venv env -
Activate the environment:
In Linux:
source env/bin/activateIn Windows:
.\env\Scripts\Activate -
Install the dependencies:
pip install -r requirements.txt
Usage
The derivation_engine.py script illustrate how to use UVengine programatically.
Basically:
# Import the UVengine
from uvengine import UVEngine
# Instantiate the engine
uvengine = UVEngine(feature_model_path=<<path_to_your_feature_model>>,
configs_path=<<list_of_paths_to_your_configs_files>>,
templates_paths=<<list_of_paths_to_your_template_files>>,
mapping_model_filepath=<<path_to_your_mapping_model_files>>)
# Resolve the variability
resolved_templates = uvengine.resolve_variability()
# Save the resolved templates to file and print the content to the standard output
for template_path, content in resolved_templates.items():
# Rename output file for avoiding overriding original templates and remove .jinja extension
output_file = pathlib.Path(template_path).with_name(pathlib.Path(template_path).stem + '_resolved' + ''.join(pathlib.Path(template_path).suffixes).replace('.jinja', ''))
with open(output_file, 'w', encoding='utf-8') as file:
file.write(content)
print(content)
Execution
The derivation_engine.py script is also the entry point interface to resolve the variability from the given inputs.
To resolve the variability over any input, execute:
python derivation_engine.py -fm FEATURE_MODEL -c CONFIGS [CONFIGS ...] -t TEMPLATES [TEMPLATES ...] [-m MAPPING_FILE]
where:
-fm FEATURE_MODEL: Feature model in UVL (.uvl).
-c CONFIGS [CONFIGS ...]: Configuration files (.json) or directy with configurations (in case of a single configuration split in multiple files).
-t TEMPLATES [TEMPLATES ...]: Template files (.jinja) or directory with templates over which the variability is resolved.
[-m MAPPING_FILE]: Optional file with the mapping between the features in the feature model and the variation points and variants in the templates (.csv).
Example:
python derivation_engine.py -fm case_studies/icecream/feature_model/icecream.uvl -c case_studies/icecream/configurations/cone.json -t case_studies/icecream/templates/main.txt.jinja -m case_studies/icecream/mapping_model/icecream.csv
As result, the final product (i.e., the templates with the variability resolved) are generated in the same template folder provided with the suffixes _resolved.
Executing the Case Studies
To facilitate the execution of the different case studies, we have prepared a Python script for each case study:
-
Ice cream:
python cs1_icecream.py -
Docker:
python cs2_docker.py
References and third-party software
Metadata
Release files for uvengine 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| uvengine-1.0.4.tar.gz | 8.4 kB | Without provenance | Details for uvengine-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| uvengine-1.0.4-py3-none-any.whl | Python 3 | none | any | Details for uvengine-1.0.4-py3-none-any.whl |
Total release size: 15.9 kB
Release files / uvengine-1.0.4.tar.gz
| Download URL | uvengine-1.0.4.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7c0417455948bc8510c31e72f8018b75d8755377cdc905315d47f98fb74c97ad
|
|
BLAKE2b-256 checksum How to use checksums |
99398a4fc890383a951a78292e2dfb4331aae72feefbbd81ec8c33df2830a7ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / uvengine-1.0.4-py3-none-any.whl
| Download URL | uvengine-1.0.4-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0dd4bcfb2493c3abba340feb6eadc62f8982803323bb1939fa1c59463130787a
|
|
BLAKE2b-256 checksum How to use checksums |
8513dfe8c9440abb1e7a80bfb5b010ec0a7a2f0a3cfa12ab7b1fbad90d69ba34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for uvengine 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.