| # Copyright lowRISC contributors. |
| # Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| # SPDX-License-Identifier: Apache-2.0 |
| r"""Standard version printing |
| import pkg_resources # part of setuptools |
| def show_and_exit(clitool: str, packages: List[str]) -> None: |
| util_path = os.path.dirname(os.path.realpath(clitool)) |
| ["git", "describe", "--always", "--dirty", "--broken"], |
| stdout=subprocess.PIPE).stdout.strip().decode('ascii') |
| ver = 'not found (not in Git repository?)' |
| sys.stderr.write(clitool + " Git version " + ver + '\n') |
| sys.stderr.write(p + ' ' + pkg_resources.require(p)[0].version + '\n') |