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

Add "sync" option for upload & download #616

Merged
merged 4 commits into from
May 10, 2021
Merged

Add "sync" option for upload & download #616

merged 4 commits into from
May 10, 2021

Conversation

jwodder
Copy link
Member

@jwodder jwodder commented May 6, 2021

Closes #365.

Does not include renaming.

@jwodder jwodder added the minor Increment the minor version when merged label May 6, 2021
@codecov
Copy link

codecov bot commented May 6, 2021

Codecov Report

Merging #616 (f698a67) into master (0288e6a) will increase coverage by 0.45%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #616      +/-   ##
==========================================
+ Coverage   84.10%   84.55%   +0.45%     
==========================================
  Files          59       59              
  Lines        5717     5932     +215     
==========================================
+ Hits         4808     5016     +208     
- Misses        909      916       +7     
Flag Coverage Δ
unittests 84.55% <93.33%> (+0.45%) ⬆️

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

Impacted Files Coverage Δ
dandi/cli/tests/test_download.py 100.00% <ø> (ø)
dandi/utils.py 81.67% <78.26%> (-0.27%) ⬇️
dandi/download.py 84.14% <91.11%> (+1.33%) ⬆️
dandi/cli/cmd_download.py 96.15% <100.00%> (+0.07%) ⬆️
dandi/cli/cmd_upload.py 55.88% <100.00%> (+1.33%) ⬆️
dandi/tests/fixtures.py 97.12% <100.00%> (ø)
dandi/tests/test_download.py 100.00% <100.00%> (ø)
dandi/tests/test_upload.py 100.00% <100.00%> (ø)
dandi/upload.py 84.10% <100.00%> (+1.51%) ⬆️
dandi/dandiset.py 84.52% <0.00%> (-1.20%) ⬇️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0288e6a...f698a67. Read the comment docs.

@jwodder jwodder marked this pull request as ready for review May 7, 2021 15:43
Copy link
Member

@yarikoptic yarikoptic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From code review alone looks fine, yet to try. Thank you @jwodder. Left minor suggestion and filed a dedicated issue about allowing for non-interactive use.

a_path = a_path.replace("\\", "/")
if a_path not in asset_paths:
to_delete.append(p)
if to_delete and click.confirm(f"Delete {len(to_delete)} local assets?"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if to_delete and click.confirm(f"Delete {len(to_delete)} local assets?"):
if to_delete and click.confirm(f"Delete {len(to_delete)} local asset{'s' if len(to_delete) > 1 else ''}?"):

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's improve UX right away, and instead of plain confirm give a choice for "[l]ist" or alike and if asked, list all the assets to be deleted so user could make an informed decision

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filed related #620 on allowing for non-interactive, which might be done after or melded into this PR if we agree before it is ready

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

dandi/tests/test_download.py Outdated Show resolved Hide resolved
dandi/tests/test_download.py Outdated Show resolved Hide resolved
dandi/upload.py Outdated Show resolved Hide resolved
@yarikoptic
Copy link
Member

Didn't try but looks great. Thank you @jwodder , let's proceed

@yarikoptic yarikoptic merged commit 5cead67 into master May 10, 2021
@yarikoptic yarikoptic deleted the gh-365 branch May 10, 2021 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

upload/download(/organize): --sync mode
2 participants