diff --git a/kin/kin.py b/kin/kin.py index 64a12ea..5f1d403 100755 --- a/kin/kin.py +++ b/kin/kin.py @@ -2,7 +2,6 @@ import sys import os -from pkg_resources import get_distribution from .verifier import Verifier from .grammar.PBXProjLexer import PBXProjLexer from .grammar.PBXProjParser import PBXProjParser @@ -28,14 +27,19 @@ def find_target_files(): def print_help(): - version = get_distribution('kin').version + try: + from pkg_resources import get_distribution # Python 3.7-3.9 + version = get_distribution('kin').version + except ImportError: + import importlib.metadata # Python 3.10+ + version = importlib.metadata.version('kin') print(("USAGE: kin [file]\n" + "DESCRIPTION: Verifies the correctness of your project.pbxproj " + "file. If no arguments are supplied, Kin will try to find a " + "project.pbxproj file in the current project.\nARGUMENTS:\n" + "\t- file\tOptionally provides the location of your " + - "project.pbxproj file\n\n" + + "project.pbxproj file\n\n" + "VERSION: " + version))