Skip to content

Implement patterns

Hannah von Reth requested to merge work/pettern into master

A pattern is a base class implemented in a blueprint category.

Other blueprints can use it:

class Package(CraftPackageObject.get('libs/qt6').pattern):
    def __init__(self):
        CraftPackageObject.get('libs/qt6').pattern.__init__(self)

This allows to provide base classes outside of the core repo of craft and reduces code duplication in the blueprints. Only a category may provide a Pattern. We should probably only allow the usage of Patterns from a parent category.

With Pattern I tried to stay close to the language of blueprints etc. but naming is not one of my talents.

See craft-blueprints-kde!356 (merged) for an example

Edited by Hannah von Reth

Merge request reports