MCPcopy Create free account
hub / github.com/feast-dev/feast / get_repo_files

Function get_repo_files

sdk/python/feast/repo_operations.py:89–112  ·  view source on GitHub ↗

Get the list of all repo files, ignoring undesired files & directories specified in .feastignore

(repo_root: Path)

Source from the content-addressed store, hash-verified

87
88
89def get_repo_files(repo_root: Path) -> List[Path]:
90 """Get the list of all repo files, ignoring undesired files & directories specified in .feastignore"""
91 # Read ignore paths from .feastignore and create a set of all files that match any of these paths
92 ignore_paths = read_feastignore(repo_root) + [
93 ".git",
94 ".feastignore",
95 ".venv",
96 "**/.ipynb_checkpoints",
97 "**/.pytest_cache",
98 "**/__pycache__",
99 ]
100 ignore_files = get_ignore_files(repo_root, ignore_paths)
101
102 # List all Python files in the root directory (recursively)
103 repo_files = {
104 p.resolve()
105 for p in repo_root.glob("**/*.py")
106 if p.is_file() and "__init__.py" != p.name
107 }
108 # Ignore all files that match any of the ignore paths in .feastignore
109 repo_files -= ignore_files
110
111 # Sort repo_files to read them in the same order every time
112 return sorted(repo_files)
113
114
115def parse_repo(repo_root: Path) -> RepoContents:

Callers 5

test_feastignore_no_fileFunction · 0.90
parse_repoFunction · 0.85

Calls 3

read_feastignoreFunction · 0.85
get_ignore_filesFunction · 0.85
resolveMethod · 0.45

Tested by 4

test_feastignore_no_fileFunction · 0.72