Skip to content

Commit

Permalink
Merge pull request #7580 from mih/remote-extension
Browse files Browse the repository at this point in the history
Load extensions in annex remote entrypoint
  • Loading branch information
mih committed Apr 17, 2024
2 parents b50f5d3 + 3b902e1 commit f82beab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions changelog.d/20240416_194511_michael.hanke_remote_extension.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### 🏠 Internal

- The main entrypoint for annex remotes now also runs the standard extension
load hook. This enables extensions to alter annex remote implementation
behavior in the same way than other DataLad components.
(by [@mih](https://github.com/mih))
7 changes: 7 additions & 0 deletions datalad/customremotes/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ def _main(args, cls):

def main(args=None, cls=None, remote_name=None, description=None):
import sys
from datalad.support.entrypoints import load_extensions
# load extensions requested by configuration
# analog to what coreapi is doing for a Python session
# importantly, load them prior to parser construction, such
# that CLI tuning is also within reach for extensions
load_extensions()

parser = setup_parser(remote_name, description)
# parse cmd args
args = parser.parse_args(args)
Expand Down

0 comments on commit f82beab

Please sign in to comment.