Closed yioda closed 1 month ago
Since the pkg_resources would be deprecated in setuptools, I should refactor the version showing option with [importlib.resources](https://docs.python.org/3.11/library/importlib.resources.html#module-importlib.resources).
pkg_resources
setuptools
[importlib.resources](https://docs.python.org/3.11/library/importlib.resources.html#module-importlib.resources)
REF: https://setuptools.pypa.io/en/latest/pkg_resources.html
Current workaround is commenting as following:
from ansible.inventory.manager import InventoryManager from ansible.parsing.dataloader import DataLoader from ansible.vars.manager import VariableManager -from pkg_resources import get_distribution from sshconf import empty_ssh_config_file, read_ssh_config_file def get_args(): parser = ArgumentParser(formatter_class=RawTextHelpFormatter) - parser.add_argument('-v', '--version', action='version', - version=get_distribution('ansible-inventory-to-ssh-config').version) parser.add_argument("inventory_file", help="ansible inventory file") parser.add_argument("-o", "--output", help="ssh config output path (default: ~/.ssh/config.ansible)",
I will fix this as soon as possible...
Fix in new version 1.1.2
1.1.2
Use importlib.metadata to replace the pkg_resource.
importlib.metadata
pkg_resource
https://github.com/yioda/ansible-inventory-to-ssh-config/releases/tag/1.1.2
Since the
pkg_resources
would be deprecated insetuptools
, I should refactor the version showing option with[importlib.resources](https://docs.python.org/3.11/library/importlib.resources.html#module-importlib.resources)
.REF: https://setuptools.pypa.io/en/latest/pkg_resources.html
Current workaround is commenting as following:
I will fix this as soon as possible...