Skip to content

Commit e322410

Browse files
authored
Merge branch 'main' into add-yaml-benchmark
2 parents b267db0 + ad43918 commit e322410

File tree

119 files changed

+15587
-2249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+15587
-2249
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
version: 2
22
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: monthly
7+
groups:
8+
actions:
9+
patterns:
10+
- "*"
11+
312
- package-ecosystem: "pip"
4-
directory: "/pyperformance/requirements"
13+
directory: "/"
14+
exclude-paths:
15+
- "pyperformance/data-files/**"
516
schedule:
617
interval: "monthly"

.github/workflows/lint.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Lint
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
permissions: {}
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v6
12+
- uses: tox-dev/action-pre-commit-uv@v1

.github/workflows/main.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ name: test
22

33
on:
44
push:
5-
branches: [main]
65
pull_request:
7-
branches: [main]
86
schedule:
97
# Midnight UTC:
108
- cron: "0 0 * * *"
@@ -22,41 +20,46 @@ jobs:
2220
fail-fast: false
2321
matrix:
2422
# Test all supported versions on Ubuntu:
25-
os: [ubuntu-latest]
26-
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
23+
os: [ubuntu-latest, ubuntu-24.04-arm]
24+
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2725
experimental: [false]
2826
build: ['']
2927
include:
3028
# As the experimental task for the dev version.
3129
- os: ubuntu-latest
32-
python: "3.13-dev"
30+
python: "3.14"
31+
experimental: true
32+
build: 'free-threading'
33+
- os: ubuntu-24.04-arm
34+
python: "3.14"
35+
experimental: true
36+
build: 'free-threading'
37+
- os: ubuntu-latest
38+
python: "3.15-dev"
3339
experimental: true
3440
- os: ubuntu-latest
35-
python: "3.13-dev"
41+
python: "3.15-dev"
3642
experimental: true
3743
build: 'free-threading'
3844
# Also test PyPy, macOS, and Windows:
3945
- os: ubuntu-latest
40-
python: pypy-3.10
41-
experimental: false
42-
- os: ubuntu-latest
43-
python: pypy-3.9
46+
python: pypy-3.11
4447
experimental: false
4548
- os: macos-latest
46-
python: "3.12"
49+
python: "3.14"
4750
experimental: true
4851
- os: windows-latest
49-
python: "3.12"
50-
experimental: true
52+
python: "3.14"
53+
experimental: false
5154
steps:
52-
- uses: actions/checkout@v4
55+
- uses: actions/checkout@v6
5356
- name: Set up Python ${{ matrix.python }}
54-
uses: actions/setup-python@v5
57+
uses: actions/setup-python@v6
5558
if: "!endsWith(matrix.python, '-dev')"
5659
with:
5760
python-version: ${{ matrix.python }}
5861
- name: Set up Python ${{ matrix.python }} using deadsnakes
59-
uses: deadsnakes/action@v3.1.0
62+
uses: deadsnakes/action@v3.2.0
6063
if: "endsWith(matrix.python, '-dev')"
6164
with:
6265
python-version: ${{ matrix.python }}

.github/workflows/mypy.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: mypy
22

3-
on:
4-
push:
5-
branches: [main]
6-
pull_request:
7-
workflow_dispatch:
3+
on: [push, pull_request, workflow_dispatch]
84

95
permissions:
106
contents: read
@@ -18,8 +14,8 @@ jobs:
1814
name: Check code with mypy
1915
runs-on: ubuntu-latest
2016
steps:
21-
- uses: actions/checkout@v3
22-
- uses: actions/setup-python@v4
17+
- uses: actions/checkout@v6
18+
- uses: actions/setup-python@v6
2319
with:
2420
cache: "pip"
2521
cache-dependency-path: "pyproject.toml"

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
id-token: write
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v6
1919
- name: Set up Python
20-
uses: actions/setup-python@v4
20+
uses: actions/setup-python@v6
2121
with:
2222
python-version: '3.x'
2323
cache: pip

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
exclude: ^pyperformance/data-files/
2+
repos:
3+
- repo: https://github.com/astral-sh/ruff-pre-commit
4+
rev: v0.13.1
5+
hooks:
6+
- id: ruff-check
7+
name: Run Ruff (lint)
8+
args: [--exit-non-zero-on-fix]
9+
- id: ruff-format
10+
name: Run Ruff (format)
11+
args: [--exit-non-zero-on-fix]
12+
13+
- repo: https://github.com/tox-dev/pyproject-fmt
14+
rev: v2.6.0
15+
hooks:
16+
- id: pyproject-fmt
17+
18+
- repo: https://github.com/abravalheri/validate-pyproject
19+
rev: v0.24.1
20+
hooks:
21+
- id: validate-pyproject

.readthedocs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
version: 2
55

66
build:
7-
os: ubuntu-22.04
7+
os: ubuntu-lts-latest
88
tools:
9-
python: "3.11"
9+
python: "3"
1010

1111
sphinx:
1212
configuration: doc/conf.py

azure-pipelines.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

dev.py

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,67 +3,67 @@
33
import os.path
44
import sys
55

6-
76
REPO_ROOT = os.path.dirname(os.path.abspath(__file__))
8-
VENVS = os.path.join(REPO_ROOT, '.venvs')
7+
VENVS = os.path.join(REPO_ROOT, ".venvs")
98

109

11-
def resolve_venv_root(kind='dev', venvsdir=VENVS):
10+
def resolve_venv_root(kind="dev", venvsdir=VENVS):
1211
import sysconfig
12+
1313
if sysconfig.is_python_build():
14-
sys.exit('please install your built Python first (or pass it using --python)')
14+
sys.exit("please install your built Python first (or pass it using --python)")
1515
# XXX Handle other implementations too?
16-
base = os.path.join(venvsdir, kind or 'dev')
16+
base = os.path.join(venvsdir, kind or "dev")
1717
major, minor = sys.version_info[:2]
18-
pyloc = ((os.path.abspath(sys.executable)
19-
).partition(os.path.sep)[2].lstrip(os.path.sep)
20-
).replace(os.path.sep, '-')
21-
return f'{base}-{major}.{minor}-{pyloc}'
18+
pyloc = (
19+
(os.path.abspath(sys.executable)).partition(os.path.sep)[2].lstrip(os.path.sep)
20+
).replace(os.path.sep, "-")
21+
return f"{base}-{major}.{minor}-{pyloc}"
2222

2323

24-
def ensure_venv_ready(venvroot=None, kind='dev', venvsdir=VENVS):
24+
def ensure_venv_ready(venvroot=None, kind="dev", venvsdir=VENVS):
2525
if sys.prefix != sys.base_prefix:
26-
assert os.path.exists(os.path.join(sys.prefix, 'pyvenv.cfg'))
26+
assert os.path.exists(os.path.join(sys.prefix, "pyvenv.cfg"))
2727
venvroot = sys.prefix
2828
python = sys.executable
29-
readyfile = os.path.join(sys.prefix, 'READY')
29+
readyfile = os.path.join(sys.prefix, "READY")
3030
isready = os.path.exists(readyfile)
3131
else:
3232
import venv
33+
3334
if not venvroot:
3435
venvroot = resolve_venv_root(kind, venvsdir)
3536
# Make sure the venv exists.
36-
readyfile = os.path.join(venvroot, 'READY')
37+
readyfile = os.path.join(venvroot, "READY")
3738
isready = os.path.exists(readyfile)
3839
if not isready:
3940
relroot = os.path.relpath(venvroot)
4041
if not os.path.exists(venvroot):
41-
print(f'creating venv at {relroot}...')
42+
print(f"creating venv at {relroot}...")
4243
else:
43-
print(f'venv {relroot} not ready, re-creating...')
44+
print(f"venv {relroot} not ready, re-creating...")
4445
venv.create(venvroot, with_pip=True, clear=True)
4546
else:
46-
assert os.path.exists(os.path.join(venvroot, 'pyvenv.cfg'))
47+
assert os.path.exists(os.path.join(venvroot, "pyvenv.cfg"))
4748
# Return the venv's Python executable.
48-
binname = 'Scripts' if os.name == 'nt' else 'bin'
49+
binname = "Scripts" if os.name == "nt" else "bin"
4950
exename = os.path.basename(sys.executable)
5051
python = os.path.join(venvroot, binname, exename)
5152

5253
# Now make sure the venv has pyperformance installed.
5354
if not isready:
5455
import subprocess
56+
5557
relroot = os.path.relpath(venvroot)
56-
print(f'venv {relroot} not ready, installing dependencies...')
58+
print(f"venv {relroot} not ready, installing dependencies...")
5759
proc = subprocess.run(
58-
[python, '-m', 'pip', 'install',
59-
'--upgrade',
60-
'--editable', REPO_ROOT],
60+
[python, "-m", "pip", "install", "--upgrade", "--editable", REPO_ROOT],
6161
)
6262
if proc.returncode != 0:
63-
sys.exit('ERROR: install failed')
64-
with open(readyfile, 'w'):
63+
sys.exit("ERROR: install failed")
64+
with open(readyfile, "w"):
6565
pass
66-
print('...venv {relroot} ready!')
66+
print("...venv {relroot} ready!")
6767

6868
return venvroot, python
6969

@@ -77,8 +77,9 @@ def main(venvroot=None):
7777

7878
# Now run pyperformance.
7979
import pyperformance.cli
80+
8081
pyperformance.cli.main()
8182

8283

83-
if __name__ == '__main__':
84+
if __name__ == "__main__":
8485
main()

doc/benchmark.conf.sample

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ lto = True
3737
# Profiled Guided Optimization (PGO)?
3838
pgo = True
3939

40+
# Build the experimental just-in-time (JIT) compiler?
41+
# Possible values are:
42+
# - no: (default) do not build the JIT or the micro-op interpreter.
43+
# The new PYTHON_JIT environment variable has no effect.
44+
# - yes: build the JIT and enable it by default. PYTHON_JIT=0 can be used to
45+
# disable it at runtime.
46+
# - yes-off: build the JIT, but do not enable it by default. PYTHON_JIT=1 can
47+
# be used to enable it at runtime.
48+
# - interpreter: do not build the JIT, but do build and enable the micro-op
49+
# interpreter. This is useful for those of us who find ourselves developing
50+
# or debugging micro-ops (but don’t want to deal with the JIT).
51+
# PYTHON_JIT=0 can be used to disable the micro-op interpreter at runtime.
52+
jit = no
53+
4054
# The space-separated list of libraries that are package-only,
4155
# i.e., locally installed but not on header and library paths.
4256
# For each such library, determine the install path and add an
@@ -82,6 +96,8 @@ affinity =
8296
# disabled.
8397
upload = False
8498

99+
# --rigorous option for 'pyperformance run'
100+
rigorous = False
85101

86102
# Configuration to upload results to a Codespeed website
87103
[upload]

0 commit comments

Comments
 (0)