Augment Generator
Augment generator - adds components to existing projects.
- class pypreset.augment_generator.AugmentComponent[source]
Bases:
StrEnumAvailable augment components.
- TEST_WORKFLOW = 'test_workflow'
- LINT_WORKFLOW = 'lint_workflow'
- DEPENDABOT = 'dependabot'
- TESTS_DIR = 'tests_dir'
- GITIGNORE = 'gitignore'
- CONFTEST = 'conftest'
- PRE_COMMIT = 'pre_commit'
- PYPI_PUBLISH = 'pypi_publish'
- DOCKERFILE = 'dockerfile'
- DEVCONTAINER = 'devcontainer'
- CODECOV = 'codecov'
- DOCUMENTATION = 'documentation'
- TOX = 'tox'
- VERSION_SYNC_GUARD = 'version_sync_guard'
- PYENV = 'pyenv'
- README = 'readme'
- __new__(value)
- class pypreset.augment_generator.AugmentResult[source]
Bases:
objectResult of an augment operation.
- Parameters:
- files_created: list[GeneratedFile]
- pypreset.augment_generator.get_augment_templates_dir()[source]
Get the directory containing augment templates.
- Return type:
- pypreset.augment_generator.create_augment_jinja_env()[source]
Create Jinja2 environment for augment templates.
- Return type:
Environment
- pypreset.augment_generator.get_augment_context(config)[source]
Build template context from augment config.
The context is designed to be compatible with README.md.j2 and other templates from the create pipeline.
- class pypreset.augment_generator.ComponentGenerator[source]
Bases:
ABCBase class for component generators.
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- __init__(project_dir, config)[source]
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- Return type:
None
- class pypreset.augment_generator.TestWorkflowGenerator[source]
Bases:
ComponentGeneratorGenerates test workflow for GitHub Actions.
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- class pypreset.augment_generator.LintWorkflowGenerator[source]
Bases:
ComponentGeneratorGenerates lint workflow for GitHub Actions.
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- class pypreset.augment_generator.DependabotGenerator[source]
Bases:
ComponentGeneratorGenerates dependabot.yml configuration.
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- class pypreset.augment_generator.TestsDirectoryGenerator[source]
Bases:
ComponentGeneratorGenerates tests directory and template test file.
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- class pypreset.augment_generator.GitignoreGenerator[source]
Bases:
ComponentGeneratorGenerates .gitignore file.
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- class pypreset.augment_generator.PypiPublishWorkflowGenerator[source]
Bases:
ComponentGeneratorGenerates PyPI publish workflow for GitHub Actions.
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- class pypreset.augment_generator.DockerfileGenerator[source]
Bases:
ComponentGeneratorGenerates Dockerfile/Containerfile and ignore file.
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- class pypreset.augment_generator.DevcontainerGenerator[source]
Bases:
ComponentGeneratorGenerates .devcontainer/devcontainer.json.
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- class pypreset.augment_generator.CodecovGenerator[source]
Bases:
ComponentGeneratorGenerates codecov.yml configuration.
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- class pypreset.augment_generator.DocumentationGenerator[source]
Bases:
ComponentGeneratorGenerates documentation scaffolding (MkDocs or Sphinx).
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- class pypreset.augment_generator.ToxGenerator[source]
Bases:
ComponentGeneratorGenerates tox.ini configuration.
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- class pypreset.augment_generator.PyenvGenerator[source]
Bases:
ComponentGeneratorGenerates .python-version file for pyenv/uv version pinning.
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- class pypreset.augment_generator.VersionSyncGuardGenerator[source]
Bases:
ComponentGeneratorGenerates scripts/check_tool_versions.py for version sync checking.
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- class pypreset.augment_generator.ReadmeGenerator[source]
Bases:
ComponentGeneratorGenerates README.md from the shared README template.
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- class pypreset.augment_generator.AugmentOrchestrator[source]
Bases:
objectOrchestrates the augment operation across components.
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- __init__(project_dir, config)[source]
- Parameters:
project_dir (
Path)config (
AugmentConfig)
- Return type:
None
- generators: list[ComponentGenerator]
- pypreset.augment_generator.augment_project(project_dir, config, force=False, components=None)[source]
Augment an existing project with workflows and tests.
- Parameters:
project_dir (
Path) – Path to the project directoryconfig (
AugmentConfig) – Augment configurationforce (
bool) – Whether to overwrite existing filescomponents (
list[AugmentComponent] |None) – Specific components to generate (None = all enabled)
- Return type:
- Returns:
AugmentResult with details of generated files