Template VariablesΒΆ

Underlying the CLI, the PTB uses Jinja to dynamically generate project-specific workflows. The rendering process is supported by the github_template_dict found in your noxconfig.py::PROJECT_CONFIG. This dictionary is inherited by default from BaseConfig.py, ensuring a standardized baseline that can be easily overridden, if necessary.

    def github_template_dict(self) -> dict[str, Any]:
        """
        Dictionary of variables to dynamically render Jinja2 templates into valid YAML
        configurations.
        """
        return {
            "dependency_manager_version": self.dependency_manager.version,
            "minimum_python_version": self.minimum_python_version,
            "os_version": self.os_version,
            "python_versions": self.python_versions,
        }

    @computed_field  # type: ignore[misc]
    @property
    def github_workflow_patcher_yaml(self) -> Path | None:
        """
        For customizing the GitHub workflow templates provided by the PTB,
        a project can define a `.workflow-patcher.yml` file containing instructions to
        delete or modify jobs in the PTB template. Modification includes replacing and
        inserting steps.

        This feature is a work-in-progress that will be completed with:
            https://github.com/exasol/python-toolbox/issues/690
        """
        workflow_patcher_yaml = self.root_path / ".workflow-patcher.yml"
        if workflow_patcher_yaml.exists():
            return workflow_patcher_yaml
        return None