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

Executables in venv/bin are only generated for console scripts #6

Open
ArmaanT opened this issue Dec 22, 2022 · 0 comments
Open

Executables in venv/bin are only generated for console scripts #6

ArmaanT opened this issue Dec 22, 2022 · 0 comments

Comments

@ArmaanT
Copy link
Contributor

ArmaanT commented Dec 22, 2022

It seems like rules_pyvenv will only create executables in the venv bin for console scripts.

For example: tox works as intended, generating venv/bin/tox. However nothing is created in the bin for py-spy or pyhcl.

py-spy is actually a rust binary that gets built by maturin, but pyhcl is just regular python.

As far as I can tell, the commonality between them is that when you unzip a wheel of those packages, you get a <package name>.data/scripts folder that contains files that should be copied into the venv bin. There's also no entry_points.txt in their .dist-info folders.

I'm not 100% if this is a bug exclusively with rules_pyvenv. It seems like repositories generated by pip_parse in rules_python all have a bin folder with the mostly correct files in them (the python files have a #!/dev/null shebang), but only the tox repository has an additional py_binary definition in its BUILD.bazel. Edit: It looks like there's a related issue already on rules_python for this: bazelbuild/rules_python#801

This was how I got to the pip_parse generated directories, assuming pip_parse is named pip:
$(bazel info output_base)/external/pip_tox
$(bazel info output_base)/external/pip_pyhcl
$(bazel info output_base)/external/pip_py_spy

I'd be happy to help work on a fix for this after discussing the best approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant