Skip to content
This repository has been archived by the owner on Apr 18, 2019. It is now read-only.

pyz_binary is missing the PyZProvider #53

Open
cmoore3 opened this issue Jan 8, 2019 · 1 comment
Open

pyz_binary is missing the PyZProvider #53

cmoore3 opened this issue Jan 8, 2019 · 1 comment

Comments

@cmoore3
Copy link

cmoore3 commented Jan 8, 2019

In order to write unit tests for pyz_binary content, my team wants to be able to add pyz_test rules that have deps on pyz_binary targets.

Unfortunately, that triggers an error because pyz_binary rules do not have the mandatory provider PyZProvider. That is also different behavior than the native rules where py_binary rules do have the py provider.

Simply updating this line to return [provider, DefaultInfo( seems to make it work as desired:
https://github.com/TriggerMail/rules_pyz/blob/master/rules_python_zip/rules_python_zip.bzl#L243

My question is, why is the provider omitted from pyz_binary rules? Can it be added?

@evanj
Copy link

evanj commented Jan 17, 2019

Interesting! Mostly because I didn't consider this case. I thought the Python rules should work the way that C++, Java, and Go rules work: if you want to share code, it needs to be in a *_library rule. The *_binary rules only produce an executable. However, you make a good point that it would be good to be similar to the py_binary rule.

We've decided to not use Bazel, so this is basically unmaintained. I am unlikely to have time to look into this, sorry. :(

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

No branches or pull requests

2 participants