File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
tests/data/bm_local_wheel Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1313import sys
1414
1515import pyperf
16+ from packaging .specifiers import SpecifierSet
1617
1718from . import _utils , _benchmark_metadata
1819
@@ -164,9 +165,12 @@ def runscript(self):
164165 def extra_opts (self ):
165166 return self ._get_metadata_value ('extra_opts' , ())
166167
168+ @property
169+ def python (self ):
170+ return SpecifierSet (self ._get_metadata_value ("python" , "" ))
171+
167172 # Other metadata keys:
168173 # * base
169- # * python
170174 # * dependencies
171175 # * requirements
172176
Original file line number Diff line number Diff line change @@ -241,11 +241,15 @@ def parse_entry(o, s):
241241
242242 # Get the selections.
243243 selected = []
244+ this_python_version = "." .join (map (str , sys .version_info [:3 ]))
244245 for bench in _benchmark_selections .iter_selections (manifest , parsed_infos ):
245246 if isinstance (bench , str ):
246247 logging .warning (f"no benchmark named { bench !r} " )
247248 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+
249253 return selected
250254
251255
Original file line number Diff line number Diff line change 11[project ]
22name = " pyperformance_bm_local_wheel"
3- requires-python = " >=3.8 "
3+ requires-python = " >=3.7 "
44dependencies = [" pyperf" ]
55urls = {repository = " https://github.com/python/pyperformance" }
66version = " 1.0"
You can’t perform that action at this time.
0 commit comments