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

"Relative module names" when importing pex_binary from a bazel git_repository #33

Open
kyessenov opened this issue Jan 23, 2017 · 2 comments

Comments

@kyessenov
Copy link

Here is what I have in my build file:

pex_binary(
name = "example",
srcs = [
    "@tools//start_esp:fetch_service_config.py",
    "@tools//start_esp:start_esp.py",
],
main = "@tools//start_esp:start_esp.py",
reqs = [
    "certifi",
    "mako>=1.0.4",
    "oauth2client>=3.0.0",
    "pyasn1>=0.1.9",
    "pyasn1-modules>=0.0.8",
    "urllib3>=1.16",
],
)

@tools is an externa repository. Trying to run this gives me an error:

Traceback (most recent call last): File ".bootstrap/_pex/pex.py", line 326, in execute File ".bootstrap/_pex/pex.py", line 258, in _wrap_coverage File ".bootstrap/_pex/pex.py", line 290, in _wrap_profiling File ".bootstrap/_pex/pex.py", line 369, in _execute File ".bootstrap/_pex/pex.py", line 427, in execute_entry File ".bootstrap/_pex/pex.py", line 432, in execute_module File "/usr/lib/python2.7/runpy.py", line 170, in run_module mod_name, loader, code, fname = _get_module_details(mod_name) File "/usr/lib/python2.7/runpy.py", line 101, in _get_module_details loader = get_loader(mod_name) File "/usr/lib/python2.7/pkgutil.py", line 464, in get_loader return find_loader(fullname) File "/usr/lib/python2.7/pkgutil.py", line 474, in find_loader for importer in iter_importers(fullname): File "/usr/lib/python2.7/pkgutil.py", line 425, in iter_importers raise ImportError("Relative module names not supported") ImportError: Relative module names not supported

@benley
Copy link
Owner

benley commented Jan 30, 2017

Thank you for the bug report, and sorry for the slow response here! I'm just getting back from vacation. This is something I've run into as well and would like to fix.

@kyessenov
Copy link
Author

You're welcome! Let me know if I can help with more context. For now, as a workaround, I'm copying the rule and the sources to the target repository with genrule.

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

2 participants