-
Notifications
You must be signed in to change notification settings - Fork 71
Don't parse stub file if interpreter is explicitly provided #128
base: master
Are you sure you want to change the base?
Conversation
I had the same issue with non-system Python runtimes as parsing stubs before checking @brandjon please could you review the fix. |
closing and reopening to kickstart CI (which didn't seem to pick up my last commit) |
@brandjon 👋 does anyone pay attention to this repo? 😢 |
|
||
if args.interpreter: | ||
interpreter = args.interpreter | ||
interpreter = args.interpreter or parse_stub(args.stub_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note parse_stub
also validates interpreter
. Really it should be broken into parse_interpreter
and validate_interpreter
then this would be:
interpreter = args.interpreter or parse_interpreter(args.stub_file)
validate_interperter(interpreter)
or something
If you have an in-workspace interpreter at label #!@python3//:bin/python3 How does the in-workspace interpreter label get translated into an absolute filepath? |
@thundergolfer Ah that's true... On my end, I'm setting |
It seems like
--stub_file
is only parsed to derive which interpreter is being used. Correct me if I'm wrong, but it seems like passing in--interpreter
should short-circuit parsing that file. Seems like this will allow for using in-workspacepy_runtime
definitions as long as the interpreter is specified explicitly in theparfile()
rule.I might be missing some important context though.