-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Karim Alweheshy
committed
Mar 1, 2024
1 parent
56f3a5f
commit 016fc08
Showing
7 changed files
with
76 additions
and
27 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
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,19 @@ | ||
"Bazel version parsing" | ||
|
||
def get_bazel_version(bazel_version = getattr(native, "bazel_version", "")): | ||
""" | ||
Parse the Bazel version into a `struct`. | ||
Args: | ||
bazel_version: String representing the Bazel version. | ||
Returns: | ||
Bazel version represented as a `struct` with the major, minor, and path attributes. | ||
""" | ||
if bazel_version: | ||
parts = bazel_version.split(".") | ||
if len(parts) > 2: | ||
return struct(major = parts[0], minor = parts[1], patch = parts[2]) | ||
|
||
# Unknown, but don't crash | ||
return struct(major = 0, minor = 0, patch = 0) |
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