https://pantsbuild.org/ logo
#development
Title
# development
a

average-vr-56795

09/09/2019, 9:43 PM
The entire rule is:
Copy code
@rule(InjectedInitDigest, [Snapshot])
def inject_init(snapshot):
  """Ensure that every package has an __init__.py file in it."""
  missing_init_files = tuple(sorted(identify_missing_init_files(snapshot.files)))
  if not missing_init_files:
    new_init_files_digest = EMPTY_DIRECTORY_DIGEST
  else:
    new_init_files_digest = yield Get(Digest, InputFilesContent(FilesContent(tuple(
      FileContent(
        path=path,
        content=b'',
      ) for path in missing_init_files
    ))))
  # TODO(#7710): Once this gets fixed, merge the original source digest and the new init digest
  # into one unified digest.
  yield InjectedInitDigest(directory_digest=new_init_files_digest)