Get the list of all repo files, ignoring undesired files & directories specified in .feastignore
(repo_root: Path)
| 87 | |
| 88 | |
| 89 | def 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 | |
| 115 | def parse_repo(repo_root: Path) -> RepoContents: |