@@ -95,6 +95,17 @@ def _pip_repository_impl(rctx):
9595 python_version = result .stdout .strip ().split (" " )[- 1 ]
9696 else :
9797 fail ("Could not determine Python version" )
98+ platforms = [
99+ "linux_aarch64" ,
100+ "linux_arm" ,
101+ "linux_ppc" ,
102+ "linux_riscv64" ,
103+ "linux_s390x" ,
104+ "linux_x86_64" ,
105+ "osx_aarch64" ,
106+ "osx_x86_64" ,
107+ "windows_x86_64" ,
108+ ]
98109
99110 marker_env = env (os = rctx .os .name , arch = rctx .os .arch , python_version = python_version )
100111 requirements_by_platform = parse_requirements (
@@ -106,17 +117,7 @@ def _pip_repository_impl(rctx):
106117 requirements_osx = rctx .attr .requirements_darwin ,
107118 requirements_windows = rctx .attr .requirements_windows ,
108119 extra_pip_args = rctx .attr .extra_pip_args ,
109- platforms = [
110- "linux_aarch64" ,
111- "linux_arm" ,
112- "linux_ppc" ,
113- "linux_riscv64" ,
114- "linux_s390x" ,
115- "linux_x86_64" ,
116- "osx_aarch64" ,
117- "osx_x86_64" ,
118- "windows_x86_64" ,
119- ],
120+ platforms = platforms ,
120121 ),
121122 extra_pip_args = rctx .attr .extra_pip_args ,
122123 evaluate_markers = lambda rctx , requirements : evaluate_markers (
@@ -126,17 +127,7 @@ def _pip_repository_impl(rctx):
126127 req : {p : p for p in plats }
127128 for req , plats in requirements .items ()
128129 },
129- platforms = {
130- "linux_aarch64" : struct (env = marker_env ),
131- "linux_arm" : struct (env = marker_env ),
132- "linux_ppc" : struct (env = marker_env ),
133- "linux_riscv64" : struct (env = marker_env ),
134- "linux_s390x" : struct (env = marker_env ),
135- "linux_x86_64" : struct (env = marker_env ),
136- "osx_aarch64" : struct (env = marker_env ),
137- "osx_x86_64" : struct (env = marker_env ),
138- "windows_x86_64" : struct (env = marker_env ),
139- },
130+ platforms = {p : struct (env = marker_env ) for p in platforms },
140131 ),
141132 extract_url_srcs = False ,
142133 logger = logger ,
0 commit comments