Source code for pyscaffold.extensions.no_skeleton

Extension that omits the creation of file ``

from pathlib import PurePath as Path
from typing import List

from .. import structure
from ..actions import Action, ActionParams, ScaffoldOpts, Structure
from . import Extension

[docs]class NoSkeleton(Extension): """Omit creation of and"""
[docs] def activate(self, actions: List[Action]) -> List[Action]: """Activate extension, see :obj:`~pyscaffold.extension.Extension.activate`.""" return self.register(actions, remove_files, after="define_structure")
[docs]def remove_files(struct: Structure, opts: ScaffoldOpts) -> ActionParams: """Remove all skeleton files from structure Args: struct: project representation as (possibly) nested :obj:`dict`. opts: given options, see :obj:`create_project` for an extensive list. Returns: Updated project representation and options """ # Namespace is not yet applied so deleting from package is enough src = Path("src") struct = structure.reject(struct, src / opts["package"] / "") struct = structure.reject(struct, "tests/") return struct, opts