Skip to content

Commit 02eaebf

Browse files
authored
Merge branch 'main' into extra_configure_flags
2 parents c8c36a0 + ee25fac commit 02eaebf

File tree

6 files changed

+106
-10
lines changed

6 files changed

+106
-10
lines changed

.github/workflows/pypi.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*.*.*'
9+
10+
jobs:
11+
build:
12+
name: Build distribution 📦
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
persist-credentials: false
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.x"
23+
- name: Install pypa/build
24+
run: |
25+
python3 -m pip install build --user
26+
- name: Build a binary wheel and a source tarball
27+
run: |
28+
python3 -m build
29+
- name: Store the distribution packages
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: python-package-distributions
33+
path: dist/
34+
35+
publish-to-pypi:
36+
name: Publish to PyPI
37+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
38+
needs:
39+
- build
40+
runs-on: ubuntu-latest
41+
environment:
42+
name: pypi
43+
url: https://pypi.org/p/bench_runner
44+
permissions:
45+
id-token: write
46+
47+
steps:
48+
- name: Download all the dists
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: python-package-distributions
52+
path: dist/
53+
- name: Publish distribution 📦 to PyPI
54+
uses: pypa/gh-action-pypi-publish@release/v1
55+
56+
github-release:
57+
name: >-
58+
Sign the Python 🐍 distribution 📦 with Sigstore
59+
and upload them to GitHub Release
60+
needs:
61+
- publish-to-pypi
62+
runs-on: ubuntu-latest
63+
64+
permissions:
65+
contents: write # IMPORTANT: mandatory for making GitHub Releases
66+
id-token: write # IMPORTANT: mandatory for sigstore
67+
68+
steps:
69+
- name: Download all the dists
70+
uses: actions/download-artifact@v4
71+
with:
72+
name: python-package-distributions
73+
path: dist/
74+
- name: Sign the dists with Sigstore
75+
uses: sigstore/[email protected]
76+
with:
77+
inputs: >-
78+
./dist/*.tar.gz
79+
./dist/*.whl
80+
- name: Create GitHub Release
81+
env:
82+
GITHUB_TOKEN: ${{ github.token }}
83+
run: >-
84+
gh release create
85+
"$GITHUB_REF_NAME"
86+
--repo "$GITHUB_REPOSITORY"
87+
--notes ""
88+
- name: Upload artifact signatures to GitHub Release
89+
env:
90+
GITHUB_TOKEN: ${{ github.token }}
91+
# Upload to GitHub Release using the `gh` CLI.
92+
# `dist/` contains the built packages, and the
93+
# sigstore-produced signatures and certificates.
94+
run: >-
95+
gh release upload
96+
"$GITHUB_REF_NAME" dist/**
97+
--repo "$GITHUB_REPOSITORY"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ For example, you can see [the Faster CPython team's benchmarking results](https:
1010

1111
Create a new empty repository on Github and clone it locally.
1212

13-
Add bench_runner to your `requirements.txt`. Since there are no PyPI releases (yet), you can install it from a tag in the git repo:
13+
Add bench_runner to your `requirements.txt`.
1414

1515
```text
16-
git+https://github.com/faster-cpython/bench_runner@{VERSION}#egg=bench_runner
16+
bench_runner=={VERSION}
1717
```
1818

1919
Replace the {VERSION} above with the latest version tag of `bench_runner`.

bench_runner/templates/_benchmark.src.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
shell: cmd
113113
run: |
114114
cd cpython
115-
PCbuild\build.bat %BUILD_FLAGS% ${{ (inputs.pgo == true) && '--pgo' || '' }} ${{ inputs.jit == true && '--experimental-jit' || '' }} ${{ inputs.tier2 == true && '--experimental-jit-interpreter' || '' }} ${{ inputs.nogil == true && '--disable-gil' || '' }} -c Release ${{ inputs.clang == true && '"/p:PlatformToolset=clangcl"' || '' }} ${{ inputs.clang == true && '"/p:LLVMInstallDir=C:\Program Files\LLVM"' || '' }} ${{ inputs.clang == true && '"/p:LLVMToolsVersion=19.1.6"' || '' }} ${{ inputs.clang == true && '--tail-call-interp' || '' }}
115+
PCbuild\build.bat %BUILD_FLAGS% ${{ (inputs.pgo == true) && '--pgo' || '' }} ${{ inputs.clang == true && '--tail-call-interp' || '' }} ${{ inputs.jit == true && '--experimental-jit' || '' }} ${{ inputs.tier2 == true && '--experimental-jit-interpreter' || '' }} ${{ inputs.nogil == true && '--disable-gil' || '' }} -c Release ${{ inputs.clang == true && '"/p:PlatformToolset=clangcl"' || '' }} ${{ inputs.clang == true && '"/p:LLVMInstallDir=C:\Program Files\LLVM"' || '' }} ${{ inputs.clang == true && '"/p:LLVMToolsVersion=19.1.6"' || '' }}
116116
- name: Copy Python to different location
117117
if: ${{ steps.should_run.outputs.should_run != 'false' }}
118118
run: |
@@ -211,7 +211,7 @@ jobs:
211211
if: ${{ steps.should_run.outputs.should_run != 'false' }}
212212
run: |
213213
cd cpython
214-
./configure ${{ inputs.pgo == true && '--enable-optimizations --with-lto=full' || '' }} ${{ inputs.tier2 == true && '--enable-experimental-jit=interpreter' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit=yes' || '' }} ${{ inputs.nogil == true && '--disable-gil' || '' }} ${{ inputs.clang == true && '--with-tail-call-interp' || '' }} ${PYTHON_CONFIGURE_FLAGS:-}
214+
./configure --enable-option-checking=fatal ${{ inputs.pgo == true && '--enable-optimizations --with-lto=full' || '' }} ${{ inputs.tier2 == true && '--enable-experimental-jit=interpreter' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit=yes' || '' }} ${{ inputs.nogil == true && '--disable-gil' || '' }} ${{ inputs.clang == true && '--with-tail-call-interp' || '' }} ${PYTHON_CONFIGURE_FLAGS:-}
215215
make ${{ runner.arch == 'ARM64' && '-j' || '-j4' }}
216216
./python -VV
217217
- name: Install pyperformance
@@ -321,7 +321,7 @@ jobs:
321321
if: ${{ steps.should_run.outputs.should_run != 'false' }}
322322
run: |
323323
cd cpython
324-
./configure ${{ inputs.pgo == true && '--enable-optimizations --with-lto=full' || '' }} ${{ inputs.tier2 == true && '--enable-experimental-jit=interpreter' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit=yes' || '' }} ${{ inputs.nogil == true && '--disable-gil' || '' }} ${{ inputs.clang == true && '--with-tail-call-interp' || '' }} ${PYTHON_CONFIGURE_FLAGS:-}
324+
./configure --enable-option-checking=fatal ${{ inputs.pgo == true && '--enable-optimizations --with-lto=full' || '' }} ${{ inputs.tier2 == true && '--enable-experimental-jit=interpreter' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit=yes' || '' }} ${{ inputs.nogil == true && '--disable-gil' || '' }} ${{ inputs.clang == true && '--with-tail-call-interp' || '' }} ${PYTHON_CONFIGURE_FLAGS:-}
325325
make -j4
326326
./python.exe -VV
327327
# On macos ARM64, actions/setup-python isn't available, so we rely on a

bench_runner/templates/_pystats.src.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
if: ${{ steps.should_run.outputs.should_run != 'false' }}
101101
run: |
102102
cd cpython
103-
./configure --enable-pystats --prefix=$PWD/install ${{ inputs.tier2 == true && '--enable-experimental-jit=interpreter' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit=yes' || '' }} ${{ inputs.nogil == true && '--disable-gil' || '' }}
103+
./configure --enable-option-checking=fatal --enable-pystats --prefix=$PWD/install ${{ inputs.tier2 == true && '--enable-experimental-jit=interpreter' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit=yes' || '' }} ${{ inputs.nogil == true && '--disable-gil' || '' }}
104104
make -j4
105105
make install
106106
- name: Install pyperformance into the system python

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ classifiers = [
1717
dependencies = [
1818
"matplotlib==3.10.1",
1919
"pyperf==2.9.0",
20-
"rich==13.9.4",
20+
"rich==14.0.0",
2121
"rich-argparse==1.7.0",
2222
"ruamel.yaml==0.18.10",
2323
"scour==0.38.2",
@@ -30,8 +30,8 @@ dynamic = ["version"]
3030
test = [
3131
"black==25.1.0",
3232
"filelock==3.18.0",
33-
"flake8==7.1.2",
34-
"pyright==1.1.397",
33+
"flake8==7.2.0",
34+
"pyright==1.1.398",
3535
"pytest==8.3.5",
3636
"pytest-xdist==3.6.1",
3737
]

tests/test_run_benchmarks.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ def test_should_run_exists_force(benchmarks_checkout, capsys, monkeypatch):
236236
removed_paths = []
237237

238238
def remove(repo, path):
239-
nonlocal removed_paths
240239
removed_paths.append(path)
241240
(repo / path).unlink()
242241

0 commit comments

Comments
 (0)