subpar icon indicating copy to clipboard operation
subpar copied to clipboard

Don't parse stub file if interpreter is explicitly provided

Open dflems opened this issue 4 years ago • 5 comments

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-workspace py_runtime definitions as long as the interpreter is specified explicitly in the parfile() rule.

I might be missing some important context though.

dflems avatar Sep 08 '20 19:09 dflems

I had the same issue with non-system Python runtimes as parsing stubs before checking args.interpreter exits with an exception. I'll dismiss my PR #129 as this PR also add interpreter to the attributes list that is better than my workaround compiler_args = ["--interpreter", "/usr/bin/python3"],

@brandjon please could you review the fix.

oxidase avatar Sep 15 '20 09:09 oxidase

closing and reopening to kickstart CI (which didn't seem to pick up my last commit)

dflems avatar Sep 16 '20 20:09 dflems

@brandjon :wave: does anyone pay attention to this repo? 😢

dflems avatar Oct 28 '20 13:10 dflems

Seems like this will allow for using in-workspace py_runtime definitions as long as the interpreter is specified explicitly in the parfile() rule.

If you have an in-workspace interpreter at label @python3//:bin/python3 won't passing this as interpreter value result in a .par with a shebang like:

#!@python3//:bin/python3

How does the in-workspace interpreter label get translated into an absolute filepath?

thundergolfer avatar May 25 '21 07:05 thundergolfer

@thundergolfer Ah that's true... On my end, I'm setting interpreter to /usr/bin/env python3 as we have some par_binarys that we export as internal tools

dflems avatar Jul 21 '21 12:07 dflems