Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sdk/python/feast/repo_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ def get_repo_files(repo_root: Path) -> List[Path]:
".git",
".feastignore",
".venv",
".pytest_cache",
"__pycache__",
".ipynb_checkpoints",
"**/.ipynb_checkpoints",
"**/.pytest_cache",
"**/__pycache__",
]
ignore_files = get_ignore_files(repo_root, ignore_paths)

Expand Down
27 changes: 27 additions & 0 deletions sdk/python/tests/unit/infra/scaffolding/test_repo_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,27 @@ def feature_repo(feastignore_contents: Optional[str]):
(repo_root / "bar").mkdir()
(repo_root / "bar/subdir1").mkdir()
(repo_root / "bar/subdir1/subdir2").mkdir()
(repo_root / "foo/__pycache__").mkdir()
(repo_root / "foo/.pytest_cache").mkdir()
(repo_root / "foo/.ipynb_checkpoints").mkdir()
(repo_root / "bar/subdir1/.ipynb_checkpoints").mkdir()
(repo_root / "bar/subdir1/subdir2/.ipynb_checkpoints").mkdir()

(repo_root / "a.py").touch()
(repo_root / ".ipynb_checkpoints/test-checkpoint.py").touch()
(repo_root / "foo/b.py").touch()
(repo_root / "foo/__pycache__/b.cpython.pyc").touch()
(repo_root / "foo/.pytest_cache/test-README.md").touch()
(repo_root / "foo/.ipynb_checkpoints/foo-checkpoint.py").touch()
(repo_root / "foo1/c.py").touch()
(repo_root / "foo1/bar/d.py").touch()
(repo_root / "bar/e.py").touch()
(repo_root / "bar/subdir1/f.py").touch()
(repo_root / "bar/subdir1/.ipynb_checkpoints/subdir1-checkpoint.py").touch()
(repo_root / "bar/subdir1/subdir2/g.py").touch()
(
repo_root / "bar/subdir1/subdir2/.ipynb_checkpoints/nested-checkpoint.py"
).touch()

if feastignore_contents:
with open(repo_root / ".feastignore", "w") as f:
Expand Down Expand Up @@ -80,6 +92,7 @@ def test_feastignore_no_stars():
{
(repo_root / "foo/b.py").resolve(),
(repo_root / "bar/subdir1/f.py").resolve(),
(repo_root / "foo/.ipynb_checkpoints/foo-checkpoint.py").resolve(),
}
)
assertpy.assert_that(get_repo_files(repo_root)).is_equal_to(
Expand Down Expand Up @@ -110,6 +123,13 @@ def test_feastignore_with_stars():
{
(repo_root / "foo/b.py").resolve(),
(repo_root / "bar/subdir1/f.py").resolve(),
(
repo_root
/ "bar/subdir1/subdir2/.ipynb_checkpoints/nested-checkpoint.py"
).resolve(),
(
repo_root / "bar/subdir1/.ipynb_checkpoints/subdir1-checkpoint.py"
).resolve(),
(repo_root / "bar/e.py").resolve(),
(repo_root / "bar/subdir1/f.py").resolve(),
(repo_root / "bar/subdir1/subdir2/g.py").resolve(),
Expand All @@ -135,6 +155,13 @@ def test_feastignore_with_stars2():
assertpy.assert_that(get_ignore_files(repo_root, ignore_paths)).is_equal_to(
{
(repo_root / "bar/subdir1/f.py").resolve(),
(
repo_root
/ "bar/subdir1/subdir2/.ipynb_checkpoints/nested-checkpoint.py"
).resolve(),
(
repo_root / "bar/subdir1/.ipynb_checkpoints/subdir1-checkpoint.py"
).resolve(),
(repo_root / "bar/e.py").resolve(),
(repo_root / "bar/subdir1/f.py").resolve(),
(repo_root / "bar/subdir1/subdir2/g.py").resolve(),
Expand Down
Loading