blob: 38a68ecc47fe5ed12f8302f3c248702d03c8df59 [file] [log] [blame]
Brian Silverman3fca9d72016-02-20 02:32:51 -05001# This repository is used to create helper __init__.py files which import things
2# under third_party at the root of the Python import namespace instead of
3# requiring third_party.xyz. in front of them.
4
5genrule(
6 name = 'google_protobuf_importer_init',
7 outs = ['google/__init__.py'],
8 cmd = 'echo "%s" > $@' % '\n'.join([
9 'import sys',
10 'import third_party.protobuf.google.protobuf',
11 'sys.modules[\'google.protobuf\'] = third_party.protobuf.google.protobuf',
12 ]),
13)
14
15py_library(
16 name = 'google_protobuf_importer',
17 visibility = ['//visibility:public'],
18 srcs = [':google_protobuf_importer_init'],
19)