@@ -81,6 +81,10 @@ def host_interpreter_minor_version() -> int:
81
81
return sys .version_info .minor
82
82
83
83
84
+ def host_interpreter_micro_version () -> int :
85
+ return sys .version_info .micro
86
+
87
+
84
88
@dataclass (frozen = True )
85
89
class Platform :
86
90
os : Optional [OS ] = None
@@ -281,6 +285,13 @@ def platform_machine(self) -> str:
281
285
def env_markers (self , extra : str ) -> Dict [str , str ]:
282
286
# If it is None, use the host version
283
287
minor_version = self .minor_version or host_interpreter_minor_version ()
288
+ # NOTE: We use the `micro_version` from the current interpreter, which
289
+ # currently works around
290
+ # https://github.com/bazelbuild/rules_python/issues/2319
291
+ #
292
+ # If we wanted to pass it to this function then we would have a combinatorial
293
+ # explosion.
294
+ micro_version = host_interpreter_micro_version ()
284
295
285
296
return {
286
297
"extra" : extra ,
@@ -291,11 +302,8 @@ def env_markers(self, extra: str) -> Dict[str, str]:
291
302
"platform_release" : "" , # unset
292
303
"platform_version" : "" , # unset
293
304
"python_version" : f"3.{ minor_version } " ,
294
- # FIXME @aignas 2024-01-14: is putting zero last a good idea? Maybe we should
295
- # use `20` or something else to avoid having weird issues where the full version is used for
296
- # matching and the author decides to only support 3.y.5 upwards.
297
- "implementation_version" : f"3.{ minor_version } .0" ,
298
- "python_full_version" : f"3.{ minor_version } .0" ,
305
+ "implementation_version" : f"3.{ minor_version } .{ micro_version } " ,
306
+ "python_full_version" : f"3.{ minor_version } .{ micro_version } " ,
299
307
# we assume that the following are the same as the interpreter used to setup the deps:
300
308
# "implementation_name": "cpython"
301
309
# "platform_python_implementation: "CPython",
0 commit comments