add py_binary rule for console_scripts
Add py_binary rule if there is console_scripts entry_point defined for the package.
ping @apt-itude would be a nice one to have
@chaoran not sure if you also ran into the issues but it seems py_binary targets are causing issues, see: https://github.com/bazelbuild/bazel/issues/7091#issuecomment-492947750
@Globegitter Yes, I just tried to run bazel run @pip_deps//pytest:bin-pytest. It gave me an error ImportError: module 'pytest' has no attribute 'main'. I was using a python library that happen to not use the same name for the library and binary file, which didn't cause me any trouble. But, anyway, I gradually start to realize that using python with bazel is lost hope. I'm waiting for Google to support python in bazel natively before I do something serious with it.
BTW I guess adding a genrule to rename the binary xxx.py file to bin-xxx.py would workaround the issue? I haven't tried it yet.
@chaoran - the way I got around this is by providing a patch functionality to a forked version of rules_pip. See https://github.com/ecosia/rules_pip/commit/adce162d080a09452369b5d24aa3a797b6b6ec21
Yeah hopefully it keeps on improving over the coming weeks/months. Now with the toolchain support there is not much missing anymore from getting it to work nicely in an OSS environment.