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: Unprotected import of sentry_sdk, which is not a dependency #2460

Merged
merged 1 commit into from
Jul 19, 2021
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
13 changes: 13 additions & 0 deletions fmriprep/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ def parse_args(args=None, namespace=None):
parser = _build_parser()
opts = parser.parse_args(args, namespace)


if opts.config_file:
skip = {} if opts.reports_only else {"execution": ("run_uuid",)}
config.load(opts.config_file, skip=skip)
Expand All @@ -609,6 +610,18 @@ def parse_args(args=None, namespace=None):
config.execution.log_level = int(max(25 - 5 * opts.verbose_count, logging.DEBUG))
config.from_dict(vars(opts))

if not config.execution.notrack:
try:
import sentry_sdk
except ImportError:
config.execution.notrack = True
config.loggers.cli.warning("Telemetry disabled because sentry_sdk is not installed.")
else:
config.loggers.cli.info(
"Telemetry system to collect crashes and errors is enabled "
"- thanks for your feedback!. Use option ``--notrack`` to opt out."
)

# Initialize --output-spaces if not defined
if config.execution.output_spaces is None:
config.execution.output_spaces = SpatialReferences(
Expand Down