Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ability to pass user flags to python interpreter (#442)
This change is meant to demonstrate the proposed update for the following feature request: #436 --- ### Changes are visible to end-users: yes Users can influence behaviour of interpreter by passing additional flags via interpreter_args attribute ### Test plan - Manual testing; Modified py_binary with new attribute ``` py_binary( name = "foo", srcs = [...], deps = [...], interpreter_options = ["-m", "debugpy", "--listen", "12345", "--wait-for-client"], ) ``` Ran bazel target `bazel run //path/to/rules_py/py_binary/target:foo` From VSCode side: - installed Python Debugger extension - updated launch.json with ``` { "version": "0.2.0", "configurations": [ { "name": "Python Debugger: Attach", "type": "debugpy", "request": "attach", "connect": { "host": "localhost", "port": 12345 } } ] } ``` Used Run&Debug tab in VSCode to set breakpoints, connect to program and debug. I also tried to do proposed here (#436) way with select and `-c dbg`, it works, but less minimalistic to show proposed change
- Loading branch information