-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate Bazel uses correct Python version
Signed-off-by: Cade Daniel <cade@anyscale.com>
- Loading branch information
1 parent
7aa1d54
commit 1f5867e
Showing
3 changed files
with
30 additions
and
0 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,26 @@ | ||
# coding: utf-8 | ||
""" | ||
Tests that are specific to minimal installations. | ||
""" | ||
|
||
import pytest | ||
import os | ||
import sys | ||
|
||
@pytest.mark.skipif(os.environ.get("RAY_MINIMAL", "0") != "1", reason="Skip unless running in a minimal install.") | ||
def test_correct_python_version(): | ||
""" | ||
Validate that Bazel uses the correct Python version in our minimal tests. | ||
""" | ||
expected_python_version = os.environ.get("EXPECTED_PYTHON_VERSION", '').strip() | ||
assert expected_python_version, f"EXPECTED_PYTHON_VERSION is {expected_python_version=}" | ||
|
||
actual_major, actual_minor = sys.version_info[:2] | ||
actual_version = f"{actual_major}.{actual_minor}" | ||
assert actual_version == expected_python_version, f"{expected_python_version=} {actual_version=}" | ||
|
||
if __name__ == "__main__": | ||
if os.environ.get("PARALLEL_CI"): | ||
sys.exit(pytest.main(["-n", "auto", "--boxed", "-vs", __file__])) | ||
else: | ||
sys.exit(pytest.main(["-sv", __file__])) |