-
Notifications
You must be signed in to change notification settings - Fork 60
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
misleading suggestion: python3-pygments should be pygments #116
Comments
I install √ ; pipx inject --force colout Pygments
injected package pygments into venv colout
done! ✨ 🌟 ✨
√ ; date | colout ".*" red --debug
[…]
[colout] WARNING: error while executing the pygment module, syntax coloring is not available
[…] Yet, the output is in red. If I try the same thing with a Python file, none of the output is colored. √ ; /usr/bin/cat src/pynpc/pynpc/console.py| colout -t python
# -*- coding: utf-8 -*-
[…]
[colout] ERROR: Unknown color: Python (maybe you forgot to install python3-pygments?) |
Noting other debug steps (and other minor errors). That $ ~/.local/pipx/venvs/colout/bin/python -c 'import sys, pygments; print("\n".join(map(repr,sys.path))); print(f"{pygments.__file__=}")'
''
'/usr/lib/python310.zip'
'/usr/lib/python3.10'
'/usr/lib/python3.10/lib-dynload'
'/home/user/.local/pipx/venvs/colout/lib/python3.10/site-packages'
'/home/user/.local/pipx/shared/lib/python3.10/site-packages'
pygments.__file__='/home/user/.local/pipx/venvs/colout/lib/python3.10/site-packages/pygments/__init__.py' I wasn't able to make use, or sense of the $ seq 3| colout . # works, with color
1
2
3
$ seq 3| colout . --resources
$ seq 3| colout . --source
[colout] ERROR: Lexer %r is not available. Run with "--resources all" to see the options.
$ seq 3| colout . --source --resources all
usage: colout [-h] [-i] [-g] [-c] [-l SCALE] [-a] [-t] [-T DIR] [-P DIR] [-d COLORMAP] [-r] [-s] [-e CHAR] [-E CHAR] [--debug]
REGEX [COLOR] [STYLE]
colout: error: unrecognized arguments: all Thankfully no one is typosquatting it, but the handwritten error message makes reference to "the pygment module". I'd hate to see someone download a nasty surprise in trying to get things working. |
@nojhan Anything you need for me to debug this further, please have no hesitation to ask. @mcint Thank you! I did not notice the potential typosquating. 😱 √ ; pwd
/home/yg/.local/pipx/venvs/colout
√ ; rg "pygment" | rg -v pygments
pipx_metadata.json: "__Path__": "/home/yg/.local/pipx/venvs/colout/bin/pygmentize",
pipx_metadata.json: "pygmentize"
pipx_metadata.json: "__Path__": "/home/yg/.local/pipx/venvs/colout/bin/pygmentize",
pipx_metadata.json: "pygmentize",
lib/python3.12/site-packages/colout/colout.py: logging.warning("error while executing the pygment module, syntax coloring is not available") It's just a typo in the error message… |
The usage for colout gives a misleading suggestion:
Note that it would be good to check for pygments before suggesting it.
The text was updated successfully, but these errors were encountered: