FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

On older versions of Python, skip benchmarks that use features introduced in newer Python versions by AlexWaygood · Pull Request #283 · python/pyperformance · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) .toml  (1) All 2 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 5 additions & 1 deletion pyperformance/_benchmark.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import sys

import pyperf
from packaging.specifiers import SpecifierSet

from . import _utils, _benchmark_metadata

Expand Down Expand Up @@ -164,9 +165,12 @@ def runscript(self):
def extra_opts(self):
return self._get_metadata_value('extra_opts', ())

@property
def python(self):
return SpecifierSet(self._get_metadata_value("python", ""))

# Other metadata keys:
# * base
# * python
# * dependencies
# * requirements

Expand Down
6 changes: 5 additions & 1 deletion pyperformance/cli.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,15 @@ def parse_entry(o, s):

# Get the selections.
selected = []
this_python_version = ".".join(map(str, sys.version_info[:3]))
for bench in _benchmark_selections.iter_selections(manifest, parsed_infos):
if isinstance(bench, str):
logging.warning(f"no benchmark named {bench!r}")
continue
selected.append(bench)
# Filter out any benchmarks that can't be run on the Python version we're running
if this_python_version in bench.python:
selected.append(bench)

return selected


Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pyperformance_bm_local_wheel"
requires-python = ">=3.8"
requires-python = ">=3.7"
dependencies = ["pyperf"]
urls = {repository = "https://github.com/python/pyperformance"}
version = "1.0"
Expand Down

Back | FazBrowse Home | New Git URL