feat: add interpreter_version_info to py_runtime#1671
Conversation
245f06c to
238de8e
Compare
f0rmiga
left a comment
There was a problem hiding this comment.
I'll let other folks bikeshed if they want.
rickeylev
left a comment
There was a problem hiding this comment.
My main comment is to use a dict/struct instead of list. This makes it easier to know which parts are check for the relevant pieces. Plus we can stash extra implementation-specific parts in there if necessary.
i.e. accept a attr.string_dict on the rule and and convert it to a struct() for the provider. Convert particular keys to their appropriate types (e.g. major/minor/patch to ints, similar to sys.version_info)
Please add tests. You can add them to //tests/py_runtime
238de8e to
ef00f2b
Compare
ef00f2b to
cee2188
Compare
cee2188 to
0090758
Compare
|
@rickeylev Can I have another pass on this please? |
|
Looks pretty good! Thank you for adding tests. Can you please add an entry to CHANGELOG.md? Then it's ready to merge. |
0090758 to
3a92745
Compare
…uild/rules_python into interpreter_version
Adds an
interpreter_version_infoattribute to thepy_runtimeand associated provider that maps to thesys.version_infovalues. This allows the version of the interpreter to be known statically, which can be useful for rule sets that depend on the interpreter, and need to build environments / pathing that contain version info (virtualenvs for example).