Title: On older versions of Python, skip benchmarks that use features introduced in newer Python versions by AlexWaygood · Pull Request #283 · python/pyperformance · GitHub
Open Graph Title: On older versions of Python, skip benchmarks that use features introduced in newer Python versions by AlexWaygood · Pull Request #283 · python/pyperformance
X Title: On older versions of Python, skip benchmarks that use features introduced in newer Python versions by AlexWaygood · Pull Request #283 · python/pyperformance
Description: All our benchmarks have a requires-python field in their pyproject.toml files, e.g.: pyperformance/pyperformance/data-files/benchmarks/bm_2to3/pyproject.toml Line 3 in 974e29c requires-python = ">=3.8" The requires-python field is added to the metadata of each benchmark as a python field here: pyperformance/pyperformance/_benchmark_metadata.py Line 22 in 974e29c 'requires-python': 'python', pyperformance/pyperformance/_benchmark_metadata.py Lines 193 to 202 in 974e29c for field, target in PEP_621_FIELDS.items(): if target is None: target = field if field == 'url': repo = project.get('urls', {}).get('repository') raise NotImplementedError elif not resolved.get(target): value = project.get(field) if value is not None: resolved[target] = value We can use that metadata to create a new python property on Benchmark objects, which returns a packaging.specifiers.SpecifierSet instance. This property can then be easily used to filter out benchmarks that require a higher version of Python than the version of Python pyperformance is running on. Fixes #281. Unblocks #280 and #268. I haven't added a test for this -- I was unsure if it was necessary, and if it was necessary, where that test should go. I'm happy to add one if that would be helpful and there's an obvious place it could go, however! I manually tested adding a benchmark that used new-in-Python-3.8 features in 1734919, and the CI passed fine (adding the same benchmark to main currently causes the CI to fail — see #280). Passing CI run on my GitHub fork: https://github.com/AlexWaygood/pyperformance/actions/runs/4813903519
Open Graph Description: All our benchmarks have a requires-python field in their pyproject.toml files, e.g.: pyperformance/pyperformance/data-files/benchmarks/bm_2to3/pyproject.toml Line ...
X Description: All our benchmarks have a requires-python field in their pyproject.toml files, e.g.: pyperformance/pyperformance/data-files/benchmarks/bm_2to3/pyproject.toml Line ...
Opengraph URL: https://github.com/python/pyperformance/pull/283
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:b7a4dc50-4f96-9381-1fdf-9b8025458772 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 8432:208CF3:4E90A5:6B99BC:6969DE7E |
| html-safe-nonce | 2d07ee59f5752378eb73d2129fe78eca5de70264980bcb282c2f6bb6863d160e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDMyOjIwOENGMzo0RTkwQTU6NkI5OUJDOjY5NjlERTdFIiwidmlzaXRvcl9pZCI6IjM0NjA4OTQ1OTYwMjk2MDM0NTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6a90058f8a89a96fb3c110df9a8cab7c3ae8bb4b711a7927a7302cac4f799a48 |
| hovercard-subject-tag | pull_request:1329493604 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/pyperformance/pull/283/checks |
| twitter:image | https://avatars.githubusercontent.com/u/66076021?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/66076021?s=400&v=4 |
| og:image:alt | All our benchmarks have a requires-python field in their pyproject.toml files, e.g.: pyperformance/pyperformance/data-files/benchmarks/bm_2to3/pyproject.toml Line ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/pyperformance git https://github.com/python/pyperformance.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 65949828 |
| octolytics-dimension-repository_nwo | python/pyperformance |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 65949828 |
| octolytics-dimension-repository_network_root_nwo | python/pyperformance |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width