Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for installation #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
5 changes: 4 additions & 1 deletion src/cmake_utils/gen_py_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why this fails, and on what filename?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fails if the filename is a directory (IsADirectoryError), in my case it was specifically python3.7/pip_chardet/chardet/METADATA

licenses += extract_licenses(filename)
except IsADirectoryError:
pass
licenses = sorted(set(licenses))

os.makedirs(os.path.dirname(args.output), exist_ok=True)
Expand Down
5 changes: 4 additions & 1 deletion src/cmake_utils/gen_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ def main():
'/usr/bin',
'/usr/local/bin',
]
python_exec = shutil.which(args.python, path=':'.join(lookup_paths))
python_exec = (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the corrent lookup path to the list above instead?

Copy link
Author

@Kenadia Kenadia Jul 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why try to anticipate every path that the user may be using? Mine was in ~/.pyenv/shims

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.
Expand Down