Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make list_paths() include dotfiles #1142

Merged
merged 1 commit into from
Oct 27, 2022
Merged

Make list_paths() include dotfiles #1142

merged 1 commit into from
Oct 27, 2022

Conversation

jwodder
Copy link
Member

@jwodder jwodder commented Oct 21, 2022

I realized while investigating dandi/dandi-archive#1336 that list_paths() is ignoring dotfiles & dotdirs, which could theoretically lead to a test not behaving properly when such files are present in a Dandiset or Zarr.

@jwodder jwodder added the internal Changes only affect the internal API label Oct 21, 2022
@codecov
Copy link

codecov bot commented Oct 21, 2022

Codecov Report

Base: 88.08% // Head: 88.05% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (da14e11) compared to base (08a2a26).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1142      +/-   ##
==========================================
- Coverage   88.08%   88.05%   -0.04%     
==========================================
  Files          73       73              
  Lines        8586     8586              
==========================================
- Hits         7563     7560       -3     
- Misses       1023     1026       +3     
Flag Coverage Δ
unittests 88.05% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
dandi/utils.py 82.20% <100.00%> (ø)
dandi/support/threaded_walk.py 92.85% <0.00%> (-1.79%) ⬇️
dandi/organize.py 82.81% <0.00%> (-0.45%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@yarikoptic
Copy link
Member

Tests seems to fail, need a look.

Note: we use this helper only in the tests

❯ git grep 'list_paths'
dandi/tests/test_dandiapi.py:from ..utils import list_paths
dandi/tests/test_dandiapi.py:    paths = list_paths(tmp_path)
dandi/tests/test_dandiapi.py:    assert list_paths(tmp_path) == [
dandi/tests/test_dandiapi.py:    assert list_paths(tmp_path) == [
dandi/tests/test_delete.py:from ..utils import list_paths
dandi/tests/test_delete.py:    assert list_paths(tmp_path) == [
dandi/tests/test_delete.py:    assert list_paths(tmp_path) == [
dandi/tests/test_delete.py:    assert list_paths(tmp_path) == [
dandi/tests/test_delete.py:    assert list_paths(tmp_path) == [
dandi/tests/test_download.py:from ..utils import list_paths
dandi/tests/test_download.py:    assert list_paths(dsdir, dirs=True) == [
dandi/tests/test_download.py:    assert list_paths(dsdir, dirs=True) == [dsdir / "dandiset.yaml"]
dandi/tests/test_download.py:    assert list_paths(dsdir, dirs=True) == [
dandi/tests/test_download.py:    assert list_paths(tmp_path, dirs=True) == [
dandi/tests/test_download.py:    assert list_paths(tmp_path, dirs=True) == [tmp_path / "coconut.txt"]
dandi/tests/test_download.py:    assert list_paths(tmp_path, dirs=True) == [tmp_path / "coconut.txt"]
dandi/tests/test_download.py:    assert list_paths(tmp_path, dirs=True) == [tmp_path / "coconut.txt"]
dandi/tests/test_download.py:    assert list_paths(tmp_path, dirs=True) == [tmp_path / "apple.txt"]
dandi/tests/test_download.py:    assert list_paths(tmp_path, dirs=True) == [
dandi/tests/test_upload.py:from ..utils import list_paths, yaml_dump
dandi/tests/test_upload.py:        p for p in list_paths(organized_nwb_dir) if p.name != dandiset_metadata_file
dandi/tests/test_upload.py:    assert list_paths(tmp_path) == [
dandi/tests/test_upload.py:    assert list_paths(tmp_path) == [
dandi/utils.py:def list_paths(dirpath: Union[str, Path], dirs: bool = False) -> List[Path]:

so generally should be ok to change its default behavior - I was afraid that it might be used in some other location, where then listing of .git and others wouldn't be desired.

@jwodder
Copy link
Member Author

jwodder commented Oct 21, 2022

@yarikoptic The test failures are due to dandi/dandi-archive#1336.

@jwodder
Copy link
Member Author

jwodder commented Oct 26, 2022

@yarikoptic The tests are now passing.

@yarikoptic
Copy link
Member

ok, before addressing #1146 we better proceed with this change.

@yarikoptic yarikoptic merged commit faa0782 into master Oct 27, 2022
@yarikoptic yarikoptic deleted the list-dotfiles branch October 27, 2022 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Changes only affect the internal API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants