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 and update init #761

Merged
merged 3 commits into from
Sep 25, 2024
Merged
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
58 changes: 36 additions & 22 deletions datalad_next/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,29 @@

__docformat__ = 'restructuredtext'

__all__ = [
'__version__',
'command_suite',
# TODO: REMOVE FOR V2.0
'lgr',
]

import logging

from datalad_next._version import __version__

# patch datalad-core
from datalad_next.patches import enabled as enabled # noqa: PLC0414

# TODO: REMOVE FOR V2.0
lgr = logging.getLogger('datalad.next')

# Defines a datalad command suite.
# This variable must be bound as a setuptools entrypoint
# to be found by datalad
command_suite = (
# description of the command suite, displayed in cmdline help
"What is next in DataLad",
'What is next in DataLad',
[
# specification of a command, any number of commands can be defined
(
Expand All @@ -34,51 +48,57 @@
# name of the command class implementation in above module
'TreeCommand',
# command name (differs from lowercase command class name)
'tree'
'tree',
),
(
'datalad_next.commands.download', 'Download', 'download',
'datalad_next.commands.download',
'Download',
'download',
),
(
'datalad_next.commands.ls_file_collection', 'LsFileCollection',
'datalad_next.commands.ls_file_collection',
'LsFileCollection',
'ls-file-collection',
),
(
'datalad_next.commands.status', 'Status',
'next-status', 'next_status',
'datalad_next.commands.status',
'Status',
'next-status',
'next_status',
),
]
],
)


# patch datalad-core
import datalad_next.patches.enabled

# register additional configuration items in datalad-core
from datalad.support.extensions import register_config
from datalad_next.constraints import (
from datalad.support.extensions import register_config # noqa: E402

from datalad_next.constraints import ( # noqa: E402
EnsureBool,
EnsureChoice,
)

register_config(
'datalad.credentials.repeat-secret-entry',
'Require entering secrets twice for interactive specification?',
type=EnsureBool(),
default=True,
dialog='yesno')
dialog='yesno',
)
register_config(
'datalad.credentials.hidden-secret-entry',
'Hide secret in interactive entry?',
type=EnsureBool(),
default=True,
dialog='yesno')
dialog='yesno',
)
register_config(
'datalad.clone.url-substitute.webdav',
'webdav(s):// clone URL substitution',
description="Convenience conversion of custom WebDAV URLs to "
description='Convenience conversion of custom WebDAV URLs to '
"git-cloneable 'datalad-annex::'-type URLs. The 'webdav://' "
"prefix implies a remote sibling in 'filetree' or 'export' mode "
"See https://docs.datalad.org/design/url_substitution.html for details",
'See https://docs.datalad.org/design/url_substitution.html for details',
dialog='question',
scope='global',
default=(
Expand Down Expand Up @@ -107,9 +127,3 @@
default=False,
dialog='yesno',
)


try:
from ._version import version as __version__
except ImportError:
pass