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

Method inputs

misc/python/materialize/cargo.py:105–132  ·  view source on GitHub ↗

Compute the files that can impact the compilation of this crate. Note that the returned list may have false positives (i.e., include files that do not in fact impact the compilation of this crate), but it is not believed to have false negatives. Returns:

(self)

Source from the content-addressed store, hash-verified

103 self.examples.append(p.parent.stem)
104
105 def inputs(self) -> set[str]:
106 """Compute the files that can impact the compilation of this crate.
107
108 Note that the returned list may have false positives (i.e., include
109 files that do not in fact impact the compilation of this crate), but it
110 is not believed to have false negatives.
111
112 Returns:
113 inputs: A list of input files, relative to the root of the
114 Cargo workspace.
115 """
116 # NOTE(benesch): it would be nice to have fine-grained tracking of only
117 # exactly the files that go into a Rust crate, but doing this properly
118 # requires parsing Rust code, and we don't want to force a dependency on
119 # a Rust toolchain for users running demos. Instead, we assume that all†
120 # files in a crate's directory are inputs to that crate.
121 #
122 # † As a development convenience, we omit mzcompose configuration files
123 # within a crate. This is technically incorrect if someone writes
124 # `include!("mzcompose.py")`, but that seems like a crazy thing to do.
125 if self._inputs_cache is not None:
126 return self._inputs_cache
127 return git.expand_globs(
128 self.root,
129 f"{self.path}/**",
130 f":(exclude){self.path}/mzcompose",
131 f":(exclude){self.path}/mzcompose.py",
132 )
133
134
135class Workspace:

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected