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

Fix `siblings` crash with missing --name #3555

Merged
merged 2 commits into from Aug 2, 2019

Conversation

@mih
Copy link
Member

commented Jul 24, 2019

Fixes #3553

Plus bonus reformatting of imports.

@kyleam
Copy link
Member

left a comment

The fix looks good to me. It applies cleanly to 0.11.x, so ideally it'd go there.

default. This option can be used to limit 'query' to a specific
sibling.""",
doc="""name of the sibling. For sibling removal and addition
with path "URLs" this option is mandatory, otherwise the hostname

This comment has been minimized.

Copy link
@kyleam

kyleam Jul 24, 2019

Member

The reader would have to infer whether 'with path "URLs" 'applies to just addition or both addition and removal. You could avoid this ambiguity if you move 'addition with path "URLs"' before "sibling removal".

This comment has been minimized.

Copy link
@yarikoptic

yarikoptic Aug 1, 2019

Member

Dear @kyleam -- could you please do what needs to be done (rebase on 0.11.x, adjust docstring here) so we could have this one merged ?

This comment has been minimized.

Copy link
@kyleam

kyleam Aug 2, 2019

Member

Done

range-diff
1:  3b708139b = 1:  d9321778e RF: Modernize imports
2:  474415ba9 ! 2:  b186b1427 BF+TST: Don't crash with missing arg (fixes gh-3553)
    @@ -13,8 +13,8 @@
     -            mandatory, otherwise the hostname part of a given URL is used as a
     -            default. This option can be used to limit 'query' to a specific
     -            sibling.""",
    -+            doc="""name of the sibling. For sibling removal and addition
    -+            with path "URLs" this option is mandatory, otherwise the hostname
    ++            doc="""name of the sibling. For addition with path "URLs" and
    ++            sibling removal this option is mandatory, otherwise the hostname
     +            part of a given URL is used as a default. This option can be used
     +            to limit 'query' to a specific sibling.""",
                  constraints=EnsureStr() | EnsureNone()),

@yarikoptic yarikoptic added this to the Release 0.12.0 milestone Aug 1, 2019

@kyleam kyleam changed the base branch from master to 0.11.x Aug 2, 2019

@kyleam kyleam force-pushed the mih:bf-3553 branch from 474415b to b186b14 Aug 2, 2019

@codecov

This comment has been minimized.

Copy link

commented Aug 2, 2019

Codecov Report

❗️ No coverage uploaded for pull request base (0.11.x@81799cd). Click here to learn what that means.
The diff coverage is 90.49%.

Impacted file tree graph

@@            Coverage Diff            @@
##             0.11.x    #3555   +/-   ##
=========================================
  Coverage          ?   82.99%           
=========================================
  Files             ?      272           
  Lines             ?    35159           
  Branches          ?        0           
=========================================
  Hits              ?    29181           
  Misses            ?     5978           
  Partials          ?        0
Impacted Files Coverage Δ
datalad/support/tests/test_gitrepo.py 99.88% <ø> (ø)
datalad/tests/test_utils.py 96.89% <ø> (ø)
datalad/plugin/check_dates.py 68.57% <ø> (ø)
datalad/distribution/add.py 62.23% <ø> (ø)
datalad/tests/utils.py 91.11% <ø> (ø)
datalad/support/tests/test_repo_save.py 100% <ø> (ø)
datalad/tests/test_direct_mode.py 100% <ø> (ø)
datalad/tests/utils_testdatasets.py 100% <ø> (ø)
datalad/customremotes/tests/test_base.py 96.92% <ø> (ø)
datalad/cmdline/tests/test_main.py 98.52% <ø> (ø)
... and 107 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 81799cd...b186b14. Read the comment docs.

@kyleam kyleam merged commit b186b14 into datalad:0.11.x Aug 2, 2019

2 of 3 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
WIP Ready for review
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
kyleam added a commit that referenced this pull request Aug 2, 2019
yarikoptic added a commit that referenced this pull request Sep 6, 2019
Merge tag '0.11.7' into debian
0.11.7 (Sep 02, 2019) -- python2-we-still-love-you-but-...

Primarily bugfixes with some optimizations and refactorings.

 Fixes

- [addurls][]
  - now provides better handling when the URL file isn't in the
    expected format.  ([#3579][])
  - always considered a relative file for the URL file argument as
    relative to the current working directory, which goes against the
    convention used by other commands of taking relative paths as
    relative to the dataset argument.  ([#3582][])

- [run-procedure][]
  - hard coded "python" when formatting the command for non-executable
    procedures ending with ".py".  `sys.executable` is now used.
    ([#3624][])
  - failed if arguments needed more complicated quoting than simply
    surrounding the value with double quotes.  This has been resolved
    for systems that support `shlex.quote`, but note that on Windows
    values are left unquoted. ([#3626][])

- [siblings][] now displays an informative error message if a local
  path is given to `--url` but `--name` isn't specified.  ([#3555][])

- [sshrun][], the command DataLad uses for `GIT_SSH_COMMAND`, didn't
  support all the parameters that Git expects it to.  ([#3616][])

- Fixed a number of Unicode py2-compatibility issues. ([#3597][])

 Enhancements and new features

- The [annotate-paths][] helper now caches subdatasets it has seen to
  avoid unnecessary calls.  ([#3570][])

- A repeated configuration query has been dropped from the handling of
  `--proc-pre` and `--proc-post`.  ([#3576][])

- Calls to `git annex find` now use `--in=.` instead of the alias
  `--in=here` to take advantage of an optimization that git-annex (as
  of the current release, 7.20190730) applies only to the
  former. ([#3574][])

- [addurls][] now suggests close matches when the URL or file format
  contains an unknown field.  ([#3594][])

- Shared logic used in the setup.py files of Datalad and its
  extensions has been moved to modules in the _datalad_build_support/
  directory.  ([#3600][])

- Get ready for upcoming git-annex dropping support for direct mode
  ([#3631][])

* tag '0.11.7': (87 commits)
  DOC: Added an entry to changelogn on merged 3631
  ENH: finalizing changelog for 0.11.7
  TST: Update tests for a git-annex without direct mode
  TST: utils: Add decorator that skips when direct mode is unsupported
  ENH: annexrepo: Refuse to initialize in direct mode if unsupported
  ENH: annexrepo: Add check_direct_mode_support method
  BF+TST: Avoid leaking patched git-annex version
  TST+RF: test_annexrepo: Split up a test
  CHANGELOG.md: Second batch for 0.11.7
  TST: run_procedure: Mark test_spaces() as known Windows failure
  TST: run_procedure: Mark test_quoting as known windows failure
  TST: run_procedure: Test more arguments that need quoting
  BF(py2): run_procedure: Avoid encoding error in log message
  TST: add run_procedure test with spaces in file name
  TST/RF: non-hardcoded Python executable
  RF: newline at end of file
  RF: helper instead of conditional
  RF: remove superfluous imports
  BF/TST: remove quoting
  ENH: replace conditionals with helper function
  ...
yarikoptic added a commit that referenced this pull request Sep 6, 2019
Merge tag '0.11.7' into debian
0.11.7 (Sep 02, 2019) -- python2-we-still-love-you-but-...

Primarily bugfixes with some optimizations and refactorings.

 Fixes

- [addurls][]
  - now provides better handling when the URL file isn't in the
    expected format.  ([#3579][])
  - always considered a relative file for the URL file argument as
    relative to the current working directory, which goes against the
    convention used by other commands of taking relative paths as
    relative to the dataset argument.  ([#3582][])

- [run-procedure][]
  - hard coded "python" when formatting the command for non-executable
    procedures ending with ".py".  `sys.executable` is now used.
    ([#3624][])
  - failed if arguments needed more complicated quoting than simply
    surrounding the value with double quotes.  This has been resolved
    for systems that support `shlex.quote`, but note that on Windows
    values are left unquoted. ([#3626][])

- [siblings][] now displays an informative error message if a local
  path is given to `--url` but `--name` isn't specified.  ([#3555][])

- [sshrun][], the command DataLad uses for `GIT_SSH_COMMAND`, didn't
  support all the parameters that Git expects it to.  ([#3616][])

- Fixed a number of Unicode py2-compatibility issues. ([#3597][])

- [download-url][] now will create leading directories of the output path
  if they do not exist ([#3646][])

 Enhancements and new features

- The [annotate-paths][] helper now caches subdatasets it has seen to
  avoid unnecessary calls.  ([#3570][])

- A repeated configuration query has been dropped from the handling of
  `--proc-pre` and `--proc-post`.  ([#3576][])

- Calls to `git annex find` now use `--in=.` instead of the alias
  `--in=here` to take advantage of an optimization that git-annex (as
  of the current release, 7.20190730) applies only to the
  former. ([#3574][])

- [addurls][] now suggests close matches when the URL or file format
  contains an unknown field.  ([#3594][])

- Shared logic used in the setup.py files of Datalad and its
  extensions has been moved to modules in the _datalad_build_support/
  directory.  ([#3600][])

- Get ready for upcoming git-annex dropping support for direct mode
  ([#3631][])

* tag '0.11.7':
  Changelog entry for download-url paths handling
  ENH: downloaders: Ensure directories for target exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.