Skip to content

Add workaround to qt.conf in conda-pack #302

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

Merged
merged 3 commits into from
Aug 6, 2020
Merged
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
11 changes: 11 additions & 0 deletions build_conda_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ def main():
else:
raise RuntimeError(f"Unknown platform: {sys.platform}")

# HACK: https://github.com/conda/conda-pack/issues/141
if sys.platform.startswith('win'):
desired_prefix = sys.prefix # escaped backslashes (\\)
in_file_prefix = sys.prefix.replace('\\', '/')
with open(os.path.join(sys.prefix, 'qt.conf')) as qtconf:
new_text = qtconf.read().replace(in_file_prefix, desired_prefix)
with open(os.path.join(sys.prefix, 'qt.conf'), 'w') as qtconf:
qtconf.write(new_text)
with open(os.path.join(sys.prefix, 'Library', 'bin', 'qt.conf'), 'w') as qtconf:
qtconf.write(new_text)

subprocess.check_call(['conda-pack', '--arcroot', args.arcroot,
'--output', args.output] + unknown_args)
os.chmod(args.output, 0o755)
Expand Down