11load ("//python/private:interpreter.bzl" , _interpreter_binary = "interpreter_binary" )
2+ load ("//python/private:repl.bzl" , "generate_repl_main" )
23load ("//python:py_binary.bzl" , "py_binary" )
34
45filegroup (
@@ -24,27 +25,38 @@ label_flag(
2425 build_setting_default = "//python:none" ,
2526)
2627
28+ generate_repl_main (
29+ name = "repl_py" ,
30+ out = "repl.py" ,
31+ src = "repl_stub.py" ,
32+ )
33+
34+ label_flag (
35+ name = "repl_stub" ,
36+ build_setting_default = "repl_stub.py" ,
37+ )
38+
39+ # The user can modify this flag to make an interpreter shell library available
40+ # for the stub. E.g. if they switch the stub for an ipython-based on, then they
41+ # can point this at their version of ipython.
42+ label_flag (
43+ name = "repl_stub_dep" ,
44+ build_setting_default = "//python/private:empty" ,
45+ )
46+
2747py_binary (
2848 name = "repl" ,
29- srcs = ["repl.py" ],
49+ srcs = [": repl.py" ],
3050 deps = [
51+ ":repl_stub_dep" ,
3152 ":repl_dep" ,
32- ":repl_lib_dep" ,
3353 ],
3454 visibility = ["//visibility:public" ],
3555)
3656
37- # The user can modify this flag to make arbitrary libraries available for import
38- # on the REPL. Anything that exposes PyInfo can be used here .
57+ # The user can modify this flag to make arbitrary PyInfo targets available for
58+ # import on the REPL.
3959label_flag (
4060 name = "repl_dep" ,
41- build_setting_default = "//python:none" ,
42- )
43-
44- # The user can modify this flag to make additional libraries available
45- # specifically for the purpose of interacting with the REPL. For example, point
46- # this at ipython in your .bazelrc file.
47- label_flag (
48- name = "repl_lib_dep" ,
49- build_setting_default = "//python:none" ,
61+ build_setting_default = "//python/private:empty" ,
5062)
0 commit comments