-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[BUG] no lexer for filename 'xxx' found #996
Comments
It's because the |
I wondered if that was the case. The file in question is auto-generated due to the #!/Users/ewels/miniconda3/envs/py3/bin/python3.7
# EASY-INSTALL-ENTRY-SCRIPT: 'nf-core','console_scripts','nf-core'
import re
import sys
# for compatibility with easy_install; see #2198
__requires__ = 'nf-core'
try:
from importlib.metadata import distribution
except ImportError:
try:
from importlib_metadata import distribution
except ImportError:
from pkg_resources import load_entry_point
def importlib_load_entry_point(spec, group, name):
dist_name, _, _ = spec.partition('==')
matches = (
entry_point
for entry_point in distribution(dist_name).entry_points
if entry_point.group == group and entry_point.name == name
)
return next(matches).load()
globals().setdefault('load_entry_point', importlib_load_entry_point)
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(load_entry_point('nf-core', 'console_scripts', 'nf-core')()) I guess you could also look at the file hashbang if present? But probably not super precise either. |
True, if the first line starts with hash bang and contains the text "python" assume a Python lexer, otherwise plain text. Seems like a reasonable approach. |
Should be fixed in 9.11.0 |
Tested, working great in my hands too. Brilliant stuff - thank you! |
Describe the bug
At the top of the tracebacks for my tool on exceptions I'm getting the following (see this GitHub Actions workflow):
Alternatively, if testing locally:
Syntax highlighting in the traceback does work correctly locally.
To Reproduce
Any traceback from https://github.com/nf-core/tools has this warning. To test locally I added an
assert False
statement here and rannf-core list
.Platform
Linux (GitHub Actions), Mac OSX (locally).
Diagnose
python -m rich.diagnose
python -m rich._windows
pip freeze | grep rich
The text was updated successfully, but these errors were encountered: