forked from bazelbuild/intellij
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support aspect template for Python (bazelbuild#7011)
- Loading branch information
1 parent
c312307
commit 05d4f57
Showing
4 changed files
with
79 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# TEMPLATE-INCLUDE-BEGIN | ||
###if( $isPythonEnabled == "true" && $bazel8OrAbove == "true" ) | ||
##load("@rules_python//python:defs.bzl", "PyInfo") | ||
###end | ||
# TEMPLATE-INCLUDE-END | ||
|
||
def py_info_in_target(target): | ||
# TEMPLATE-IGNORE-BEGIN | ||
return PyInfo in target | ||
# TEMPLATE-IGNORE-END | ||
|
||
# TEMPLATE-INCLUDE-BEGIN | ||
## #if( $isPythonEnabled == "true" ) | ||
## return PyInfo in target | ||
## #else | ||
## return None | ||
## #end | ||
# TEMPLATE-INCLUDE-END | ||
|
||
def get_py_info(target): | ||
# TEMPLATE-IGNORE-BEGIN | ||
if PyInfo in target: | ||
return target[PyInfo] | ||
else: | ||
return None | ||
# TEMPLATE-IGNORE-END | ||
|
||
# TEMPLATE-INCLUDE-BEGIN | ||
## #if( $isPythonEnabled == "true" ) | ||
## if PyInfo in target: | ||
## return target[PyInfo] | ||
## else: | ||
## return None | ||
## #else | ||
## return None | ||
## #end | ||
# TEMPLATE-INCLUDE-END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters