@@ -244,24 +244,34 @@ def create_nested_marker(
244244
245245 marker = glue .join (parts )
246246 elif isinstance (constraint , Version ):
247+ if name == "python_version" and constraint .precision >= 3 :
248+ name = "python_full_version"
249+
247250 marker = '{} == "{}"' .format (name , constraint .text )
248251 else :
249252 if constraint .min is not None :
250253 op = ">="
251254 if not constraint .include_min :
252255 op = ">"
253256
254- version = constraint .min . text
257+ version = constraint .min
255258 if constraint .max is not None :
256- text = '{} {} "{}"' .format (name , op , version )
259+ min_name = max_name = name
260+ if min_name == "python_version" and constraint .min .precision >= 3 :
261+ min_name = "python_full_version"
262+
263+ if max_name == "python_version" and constraint .max .precision >= 3 :
264+ max_name = "python_full_version"
265+
266+ text = '{} {} "{}"' .format (min_name , op , version )
257267
258268 op = "<="
259269 if not constraint .include_max :
260270 op = "<"
261271
262272 version = constraint .max
263273
264- text += ' and {} {} "{}"' .format (name , op , version )
274+ text += ' and {} {} "{}"' .format (max_name , op , version )
265275
266276 return text
267277 elif constraint .max is not None :
@@ -273,6 +283,9 @@ def create_nested_marker(
273283 else :
274284 return ""
275285
286+ if name == "python_version" and version .precision >= 3 :
287+ name = "python_full_version"
288+
276289 marker = '{} {} "{}"' .format (name , op , version )
277290
278291 return marker
0 commit comments