@@ -161,11 +161,14 @@ def print(self, *args: Any, **kwargs: Any) -> None:
161
161
dunder_name = prefix_settings .get ('dunder_name' ,'__main__' )
162
162
requires = prefix_settings .get ('requires' )
163
163
164
+ ruff_target_version :str = 'py39'
164
165
if python_version :
165
166
python_version_info = tuple (int (v )for v in python_version .split ('.' ))
166
167
if sys .version_info < python_version_info :
167
168
pytest .skip (f'Python version{ python_version } required' )# pragma: lax no cover
168
169
170
+ ruff_target_version = f'py{ python_version_info [0 ]} { python_version_info [1 ]} '
171
+
169
172
if opt_test .startswith ('skip' )and opt_lint .startswith ('skip' ):
170
173
pytest .skip ('both running code and lint skipped' )
171
174
@@ -188,7 +191,7 @@ def print(self, *args: Any, **kwargs: Any) -> None:
188
191
189
192
line_length = int (prefix_settings .get ('line_length' ,'88' ))
190
193
191
- eval_example .set_config (ruff_ignore = ruff_ignore ,target_version = 'py39' ,line_length = line_length )
194
+ eval_example .set_config (ruff_ignore = ruff_ignore ,target_version = ruff_target_version ,line_length = line_length )# type: ignore[reportArgumentType]
192
195
eval_example .print_callback = print_callback
193
196
eval_example .include_print = custom_include_print
194
197