TriggerMail / rules_pyz

Bazel Python rules that package everything in an executable zip
Apache License 2.0
29 stars 19 forks source link

pip_generate.go cannot be used #40

Open pcj opened 6 years ago

pcj commented 6 years ago

Looks like the pip_generate executable (osx) has a hardcoded path from a user home directory:

/bazel-bin/external/com_bluecore_rules_pyz/pypi/pip_generate_wrapper     -requirements requirements.txt     -outputDir third_party/pypi     -wheelURLPrefix http://example.com/     -wheelDir wheels
panic: open third_party/pypi/pypi_rules.bzl: no such file or directory

goroutine 1 [running]:
main.main()
    /Users/evanjones/t/rules_pyz/pypi/pip_generate.go:340 +0x4546

Why not use rules_go to build this directly?

evanj commented 6 years ago

This appears to be a relative path in the error; does the directory third_party/pypi exist in the -directory you are running this? Try mkdir -p third_party/pypi before running it? The tool probably should create that directory if it doesn't exist ...

The goal was to avoid needing to download all the dependencies in rules_go for a tool used with Python, so I checked in the binaries. This is definitely gross, and it might be better to just use rules_go. Even better would probably be to port the tool to Python so it doesn't depend on Go at all. Disregarding my personal feelings about programming languages, avoiding that dependency would be an improvement.