File tree 3 files changed +11
-3
lines changed
tests/data/bm_local_wheel
3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 13
13
import sys
14
14
15
15
import pyperf
16
+ from packaging .specifiers import SpecifierSet
16
17
17
18
from . import _utils , _benchmark_metadata
18
19
@@ -164,9 +165,12 @@ def runscript(self):
164
165
def extra_opts (self ):
165
166
return self ._get_metadata_value ('extra_opts' , ())
166
167
168
+ @property
169
+ def python (self ):
170
+ return SpecifierSet (self ._get_metadata_value ("python" , "" ))
171
+
167
172
# Other metadata keys:
168
173
# * base
169
- # * python
170
174
# * dependencies
171
175
# * requirements
172
176
Original file line number Diff line number Diff line change @@ -241,11 +241,15 @@ def parse_entry(o, s):
241
241
242
242
# Get the selections.
243
243
selected = []
244
+ this_python_version = "." .join (map (str , sys .version_info [:3 ]))
244
245
for bench in _benchmark_selections .iter_selections (manifest , parsed_infos ):
245
246
if isinstance (bench , str ):
246
247
logging .warning (f"no benchmark named { bench !r} " )
247
248
continue
248
- selected .append (bench )
249
+ # Filter out any benchmarks that can't be run on the Python version we're running
250
+ if this_python_version in bench .python :
251
+ selected .append (bench )
252
+
249
253
return selected
250
254
251
255
Original file line number Diff line number Diff line change 1
1
[project ]
2
2
name = " pyperformance_bm_local_wheel"
3
- requires-python = " >=3.8 "
3
+ requires-python = " >=3.7 "
4
4
dependencies = [" pyperf" ]
5
5
urls = {repository = " https://github.com/python/pyperformance" }
6
6
version = " 1.0"
You can’t perform that action at this time.
0 commit comments