MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / collect_files

Function collect_files

tools/generate_sbom_requirements.py:17–33  ·  view source on GitHub ↗

Collect requirement files to include in SBOM requirements. Args: root (Path): The root directory of the repository. Returns: list[Path]: A list of Paths to requirement files to include in the SBOM.

(root: Path)

Source from the content-addressed store, hash-verified

15
16
17def collect_files(root: Path) -> list[Path]:
18 """Collect requirement files to include in SBOM requirements.
19
20 Args:
21 root (Path): The root directory of the repository.
22
23 Returns:
24 list[Path]: A list of Paths to requirement files to include in the SBOM.
25 """
26 files = []
27
28 # requirements.txt + all requirements/**/*.txt
29 for p in [root / "requirements.txt", *root.glob("requirements/**/*.txt")]:
30 if p.is_file() and p.name not in EXCLUDED_NAMES:
31 files.append(p)
32
33 return files
34
35
36def write_combined_req_files(root: Path, files: list[Path], outname: str) -> Path:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected