From 16e3a8b57055156a861dcf3cba9bc037b3fe654c Mon Sep 17 00:00:00 2001 From: Kenneth Schiller Date: Mon, 12 Jul 2021 23:12:09 -0700 Subject: [PATCH] Fixes for installation --- .gitignore | 1 + src/cmake_utils/gen_py_lib.py | 5 ++++- src/cmake_utils/gen_venv.py | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..378eac2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build diff --git a/src/cmake_utils/gen_py_lib.py b/src/cmake_utils/gen_py_lib.py index c8acaa7..5c18f08 100755 --- a/src/cmake_utils/gen_py_lib.py +++ b/src/cmake_utils/gen_py_lib.py @@ -71,7 +71,10 @@ def main(): d = d.split(':')[-1] metadata_files = glob.glob(os.path.join(d, '*/METADATA')) for filename in metadata_files: - licenses += extract_licenses(filename) + try: + licenses += extract_licenses(filename) + except IsADirectoryError: + pass licenses = sorted(set(licenses)) os.makedirs(os.path.dirname(args.output), exist_ok=True) diff --git a/src/cmake_utils/gen_venv.py b/src/cmake_utils/gen_venv.py index e79237b..c56fb25 100755 --- a/src/cmake_utils/gen_venv.py +++ b/src/cmake_utils/gen_venv.py @@ -103,7 +103,10 @@ def main(): '/usr/bin', '/usr/local/bin', ] - python_exec = shutil.which(args.python, path=':'.join(lookup_paths)) + python_exec = ( + shutil.which(args.python, path=':'.join(lookup_paths)) or + shutil.which(args.python) + ) # Prepare an empty virtual environment in the background. # --symlinks prefers symlinks of copying. # --without-pip installs a completely empty venv, with no pip.