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

Make a value of 'imports' property of py_library rule visible in Skylark #2617

Closed
nuh-temp opened this issue Mar 1, 2017 · 4 comments
Closed
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Rules-Python Native rules for Python type: feature request

Comments

@nuh-temp
Copy link

nuh-temp commented Mar 1, 2017

In most cases that parameter indicates a path to library's sources and widely used along with new_[git|local]_repository rules in order to setup import path for external python libraries.
In some cases all such libraries should go through additional processing, like for example, if library is used with AppEngine you need to put it into a folder which is known to AppEngine to be able to import it properly.

@hermione521
Copy link
Contributor

@lberki what do you think?

@evanj
Copy link

evanj commented Jun 17, 2017

I just ran into this while attempting to figure out how to build a Python mono-repo that puts separate Python packages in different sub-directories. We would like to be able to use PEX, since that can package pre-built wheels which Bazel doesn't support yet. While trying to figure out how to write custom rules to support this, I discovered that I can't because I can't access imports from Skylark. See benley/bazel_rules_pex#36 for more motivation.

@duggelz
Copy link

duggelz commented Nov 1, 2017

I work around this by parsing the imports list from the generated stub files, but it's a brittle solution that doesn't work on Windows, and occasionally breaks for other reasons.

@c4urself
Copy link
Contributor

c4urself commented Apr 6, 2018

ran into this as well -- there are workarounds but the cleanest way is to have imports available.

asafflesch added a commit to asafflesch/bazel that referenced this issue Oct 17, 2018
Fixes bazelbuild#2617. Basically just re-packaging the code and tests from srikalyan#1.
asafflesch added a commit to asafflesch/bazel that referenced this issue Oct 17, 2018
Fixes bazelbuild#2617. Basically just re-packaging the code and
tests from srikalyan#1.
@brandjon brandjon added type: feature request P2 We'll consider working on this in future. (Assignee optional) team-Rules-Python Native rules for Python and removed under investigation labels Oct 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Rules-Python Native rules for Python type: feature request
Projects
None yet
Development

No branches or pull requests

6 participants