File tree Expand file tree Collapse file tree 4 files changed +88
-0
lines changed
e2e/interpreter-version-541 Expand file tree Collapse file tree 4 files changed +88
-0
lines changed Original file line number Diff line number Diff line change 2929 folders : |
3030 [
3131 "e2e/cross-repo-610",
32+ "e2e/interpreter-version-541",
3233 "e2e/repository-rule-deps",
3334 "e2e/smoke",
3435 "e2e/system-interpreter",
4142 [
4243 {"os": "windows-latest"},
4344 {"folder": "e2e/cross-repo-610", "bzlmodEnabled": false},
45+ {"folder": "e2e/interpreter-version-541", "bzlmodEnabled": false},
4446 {"folder": "e2e/repository-rule-deps", "bzlmodEnabled": false},
4547 {"folder": "e2e/system-interpreter", "bzlmodEnabled": false},
4648 {"folder": "examples/uv_pip_compile", "bzlmodEnabled": false},
Original file line number Diff line number Diff line change 1+ load ("@aspect_bazel_lib//lib:expand_template.bzl" , "expand_template" )
2+ load ("@aspect_rules_py//py:defs.bzl" , "py_test" )
3+ load ("@aspect_rules_py//py/unstable:defs.bzl" , "py_venv_test" )
4+
5+ [
6+ [
7+ expand_template (
8+ name = "expanded_test_{}.py" .format (ver .replace ("." , "_" )),
9+ out = "test_{}.py" .format (ver .replace ("." , "_" )),
10+ substitutions = {
11+ "<VERSION>" : ver ,
12+ },
13+ template = "test.py" ,
14+ ),
15+ py_venv_test (
16+ name = "test_{}_venv" .format (ver .replace ("." , "_" )),
17+ srcs = [
18+ "expanded_test_{}.py" .format (ver .replace ("." , "_" )),
19+ ],
20+ imports = [
21+ "." ,
22+ ],
23+ main = "expanded_test_{}.py" .format (ver .replace ("." , "_" )),
24+ python_version = ver ,
25+ ),
26+ py_test (
27+ name = "test_{}_classic" .format (ver .replace ("." , "_" )),
28+ srcs = [
29+ "expanded_test_{}.py" .format (ver .replace ("." , "_" )),
30+ ],
31+ imports = [
32+ "." ,
33+ ],
34+ main = "expanded_test_{}.py" .format (ver .replace ("." , "_" )),
35+ python_version = ver ,
36+ ),
37+ ]
38+ for ver in [
39+ "3.11" ,
40+ "3.12" ,
41+ "3.13" ,
42+ ]
43+ ]
Original file line number Diff line number Diff line change 1+ "Bazel dependencies"
2+
3+ bazel_dep (name = "aspect_rules_py" , version = "0.0.0" , dev_dependency = True )
4+ local_path_override (
5+ module_name = "aspect_rules_py" ,
6+ path = "../.." ,
7+ )
8+
9+ bazel_dep (name = "aspect_bazel_lib" , version = "2.16.0" )
10+
11+ bazel_dep (name = "rules_python" , version = "1.6.3" , dev_dependency = True )
12+
13+ python = use_extension ("@rules_python//python/extensions:python.bzl" , "python" )
14+ python .toolchain (
15+ python_version = "3.11" ,
16+ )
17+ python .toolchain (
18+ python_version = "3.12" ,
19+ )
20+ python .toolchain (
21+ python_version = "3.13" ,
22+ )
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+
3+ import sys
4+ import site
5+
6+ print ("---" )
7+ print ("__file__:" , __file__ )
8+ print ("sys.prefix:" , sys .prefix )
9+ print ("sys.executable:" , sys .executable )
10+ print ("site.PREFIXES:" )
11+ for p in site .PREFIXES :
12+ print (" -" , p )
13+
14+ # The virtualenv module should have already been loaded at interpreter startup
15+ assert "_virtualenv" in sys .modules
16+
17+ # Assert that we booted against the expected interpreter version
18+ EXPECTED_VERSION = "<VERSION>"
19+ print (repr (EXPECTED_VERSION ))
20+ print (repr (sys .version ))
21+ assert sys .version .startswith (EXPECTED_VERSION )
You can’t perform that action at this time.
0 commit comments