Skip to content

Commit 5de943b

Browse files
committed
Record relevant versions in log output
1 parent 3237223 commit 5de943b

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

bpython/args.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The MIT License
22
#
33
# Copyright (c) 2008 Bob Farrell
4-
# Copyright (c) 2012-2020 Sebastian Ramacher
4+
# Copyright (c) 2012-2021 Sebastian Ramacher
55
#
66
# Permission is hereby granted, free of charge, to any person obtaining a copy
77
# of this software and associated documentation files (the "Software"), to deal
@@ -26,16 +26,23 @@
2626
"""
2727

2828
import argparse
29+
import curtsies
30+
import cwcwidth
31+
import greenlet
2932
import importlib.util
3033
import logging
3134
import os
35+
import pygments
36+
import requests
3237
import sys
3338
from pathlib import Path
3439

3540
from . import __version__, __copyright__
3641
from .config import default_config_path, loadini, Struct
3742
from .translations import _
3843

44+
logger = logging.getLogger(__name__)
45+
3946

4047
class ArgumentParserFailed(ValueError):
4148
"""Raised by the RaisingOptionParser for a bogus commandline."""
@@ -184,6 +191,25 @@ def callback(group):
184191
bpython_logger.addHandler(logging.NullHandler())
185192
curtsies_logger.addHandler(logging.NullHandler())
186193

194+
logger.info(f"Starting bpython {__version__}")
195+
logger.info(f"Python {sys.executable}: {sys.version_info}")
196+
logger.info(f"curtsies: {curtsies.__version__}")
197+
logger.info(f"cwcwidth: {cwcwidth.__version__}")
198+
logger.info(f"greenlet: {greenlet.__version__}")
199+
logger.info(f"pygments: {pygments.__version__}")
200+
logger.info(f"requests: {requests.__version__}")
201+
logger.info(
202+
"environment:\n{}".format(
203+
"\n".join(
204+
f"{key}: {value}"
205+
for key, value in sorted(os.environ.items())
206+
if key.startswith("LC")
207+
or key.startswith("LANG")
208+
or key == "TERM"
209+
)
210+
)
211+
)
212+
187213
config = Struct()
188214
loadini(config, options.config)
189215

0 commit comments

Comments
 (0)