At least for me with Python 3.9 and chess version 0.3.6.
I don't really understand how the way the parser is handling this at the moment works, although fanc seems to use the same approach successfully. All my google searching lead to a different way of handling this, like this, which works for me:
from .version import __version__
parser.add_argument('--version', action='version', version=__version__)
From what I've seen online it seems like from .version import __version__ only needs to be in __init__.py, but it didn't work until I added this into commands.py as well. I tried just adding that line at the top of commands.py and keeping the code the same, but that didn't help.
At least for me with Python 3.9 and chess version 0.3.6.
I don't really understand how the way the parser is handling this at the moment works, although fanc seems to use the same approach successfully. All my google searching lead to a different way of handling this, like this, which works for me:
From what I've seen online it seems like
from .version import __version__
only needs to be in__init__.py
, but it didn't work until I added this intocommands.py
as well. I tried just adding that line at the top ofcommands.py
and keeping the code the same, but that didn't help.