MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / Copy

Class Copy

misc/python/materialize/mzbuild.py:554–582  ·  view source on GitHub ↗

A `PreImage` action which copies files from a directory. See doc/developer/mzbuild.md for an explanation of the user-facing parameters.

Source from the content-addressed store, hash-verified

552
553
554class Copy(PreImage):
555 """A `PreImage` action which copies files from a directory.
556
557 See doc/developer/mzbuild.md for an explanation of the user-facing
558 parameters.
559 """
560
561 def __init__(self, rd: RepositoryDetails, path: Path, config: dict[str, Any]):
562 super().__init__(rd, path)
563
564 self.source = config.pop("source", None)
565 if self.source is None:
566 raise ValueError("mzbuild config is missing 'source' argument")
567
568 self.destination = config.pop("destination", None)
569 if self.destination is None:
570 raise ValueError("mzbuild config is missing 'destination' argument")
571
572 self.matching = config.pop("matching", "*")
573
574 def run(self, prep: Any) -> None:
575 super().run(prep)
576 for src in self.inputs():
577 dst = self.path / self.destination / src
578 dst.parent.mkdir(parents=True, exist_ok=True)
579 shutil.copy(self.rd.root / self.source / src, dst)
580
581 def inputs(self) -> set[str]:
582 return set(git.expand_globs(self.rd.root / self.source, self.matching))
583
584
585class CargoPreImage(PreImage):

Callers 2

parse_copyMethod · 0.85
__init__Method · 0.85

Implementers 3

row.rssrc/repr/src/row.rs
range.rssrc/repr/src/adt/range.rs
lib.rssrc/row-spine/src/lib.rs

Calls

no outgoing calls

Tested by

no test coverage detected