jaraco / keyring

MIT License
1.26k stars 159 forks source link

No such file or directory: '/usr/lib/python3.10/site-packages/keyring/backend_complete.zsh' #621

Closed dymn closed 1 year ago

dymn commented 1 year ago

Describe the bug Keyring throw exception.

To Reproduce Steps to reproduce the behavior:

$  keyring get jg personal                                                                                                                                                    
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.10/keyring", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/keyring/cli.py", line 133, in main
    cli = CommandLineTool()
  File "/usr/lib/python3.10/site-packages/keyring/cli.py", line 52, in __init__
    completion.install(self.parser)
  File "/usr/lib/python3.10/site-packages/keyring/completion.py", line 49, in install
    install_completion(parser)
  File "/usr/lib/python3.10/site-packages/keyring/completion.py", line 39, in install_completion
    zsh=files(__package__).joinpath('backend_complete.zsh').read_text(),
  File "/usr/lib/python3.10/pathlib.py", line 1134, in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
  File "/usr/lib/python3.10/pathlib.py", line 1119, in open
    return self._accessor.open(self, mode, buffering, encoding, errors,
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3.10/site-packages/keyring/backend_complete.zsh'

Expected behavior The keyring should output the saved password, like in keyring-23.11.0.

Environment

$  pip list | grep keyring                                                                                                                                             
keyring                23.13.1

$ keyring --list-backends
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.10/keyring", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/keyring/cli.py", line 133, in main
    cli = CommandLineTool()
  File "/usr/lib/python3.10/site-packages/keyring/cli.py", line 52, in __init__
    completion.install(self.parser)
  File "/usr/lib/python3.10/site-packages/keyring/completion.py", line 49, in install
    install_completion(parser)
  File "/usr/lib/python3.10/site-packages/keyring/completion.py", line 39, in install_completion
    zsh=files(__package__).joinpath('backend_complete.zsh').read_text(),
  File "/usr/lib/python3.10/pathlib.py", line 1134, in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
  File "/usr/lib/python3.10/pathlib.py", line 1119, in open
    return self._accessor.open(self, mode, buffering, encoding, errors,
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3.10/site-packages/keyring/backend_complete.zsh'
mgorny commented 1 year ago

I think the problem is that backend_complete.zsh is not included in the wheel when it's built from GitHub archive with SETUPTOOLS_SCM_PRETEND_VERSION.

mgorny commented 1 year ago

py.typed is also missing.