Skip to content

Commit 09d955f

Browse files
committed
Revert "rm"
This reverts commit 14c5e89.
1 parent ca594f0 commit 09d955f

19 files changed

+1181
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Add issue header
2+
# Automatically edits an issue's descriptions with a header,
3+
# one of:
4+
#
5+
# - Bug report
6+
# - Crash report
7+
# - Feature or enhancement
8+
9+
on:
10+
issues:
11+
types:
12+
# Only ever run once
13+
- opened
14+
15+
16+
jobs:
17+
add-header:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
issues: write
21+
steps:
22+
- uses: actions/github-script@v7
23+
with:
24+
# language=JavaScript
25+
script: |
26+
// https://devguide.python.org/triage/labels/#type-labels
27+
const HEADERS = new Map([
28+
['type-bug', 'Bug report'],
29+
['type-crash', 'Crash report'],
30+
['type-feature', 'Feature or enhancement'],
31+
]);
32+
let issue_data = await github.rest.issues.get({
33+
issue_number: context.issue.number,
34+
owner: context.repo.owner,
35+
repo: context.repo.repo
36+
}).then(issue => issue.data);
37+
let header = '';
38+
for (const label_data of issue_data.labels) {
39+
const label_name = (typeof label_data === 'string') ? label_data : label_data.name;
40+
if (HEADERS.has(label_name)) {
41+
header = HEADERS.get(label_name);
42+
break;
43+
}
44+
}
45+
if (header !== '') {
46+
console.log(`Setting new header: ${header}`);
47+
await github.rest.issues.update({
48+
issue_number: context.issue.number,
49+
owner: context.repo.owner,
50+
repo: context.repo.repo,
51+
body: `# ${header}\n\n${issue_data.body.replaceAll('\r', '')}`
52+
});
53+
}

.github/workflows/build.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@ name: Tests
33
on:
44
workflow_dispatch:
55
push:
6+
branches:
7+
- 'main'
8+
- '3.*'
69
pull_request:
10+
branches:
11+
- 'main'
12+
- '3.*'
713

814
permissions:
915
contents: read
1016

17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-reusable
19+
cancel-in-progress: true
20+
1121
env:
1222
FORCE_COLOR: 1
1323

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Read the Docs PR preview
2+
# Automatically edits a pull request's descriptions with a link
3+
# to the documentation's preview on Read the Docs.
4+
5+
on:
6+
pull_request_target:
7+
types:
8+
- opened
9+
paths:
10+
- 'Doc/**'
11+
- '.github/workflows/doc.yml'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
documentation-links:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
pull-requests: write
22+
23+
steps:
24+
- uses: readthedocs/actions/preview@v1
25+
with:
26+
project-slug: "cpython-previews"
27+
single-version: "true"

.github/workflows/jit.yml

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
name: JIT
2+
on:
3+
pull_request:
4+
paths:
5+
- '**jit**'
6+
- 'Python/bytecodes.c'
7+
- 'Python/optimizer*.c'
8+
- '!Python/perf_jit_trampoline.c'
9+
- '!**/*.md'
10+
- '!**/*.ini'
11+
push:
12+
paths:
13+
- '**jit**'
14+
- 'Python/bytecodes.c'
15+
- 'Python/optimizer*.c'
16+
- '!Python/perf_jit_trampoline.c'
17+
- '!**/*.md'
18+
- '!**/*.ini'
19+
workflow_dispatch:
20+
21+
permissions:
22+
contents: read
23+
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
26+
cancel-in-progress: true
27+
28+
env:
29+
FORCE_COLOR: 1
30+
31+
jobs:
32+
interpreter:
33+
name: Interpreter (Debug)
34+
runs-on: ubuntu-24.04
35+
timeout-minutes: 90
36+
steps:
37+
- uses: actions/checkout@v4
38+
with:
39+
persist-credentials: false
40+
- name: Build tier two interpreter
41+
run: |
42+
./configure --enable-experimental-jit=interpreter --with-pydebug
43+
make all --jobs 4
44+
- name: Test tier two interpreter
45+
run: |
46+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
47+
jit:
48+
name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }})
49+
needs: interpreter
50+
runs-on: ${{ matrix.runner }}
51+
timeout-minutes: 90
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
target:
56+
- i686-pc-windows-msvc/msvc
57+
- x86_64-pc-windows-msvc/msvc
58+
- aarch64-pc-windows-msvc/msvc
59+
- x86_64-apple-darwin/clang
60+
- aarch64-apple-darwin/clang
61+
- x86_64-unknown-linux-gnu/gcc
62+
- aarch64-unknown-linux-gnu/gcc
63+
debug:
64+
- true
65+
- false
66+
llvm:
67+
- 19
68+
include:
69+
- target: i686-pc-windows-msvc/msvc
70+
architecture: Win32
71+
runner: windows-latest
72+
- target: x86_64-pc-windows-msvc/msvc
73+
architecture: x64
74+
runner: windows-latest
75+
- target: aarch64-pc-windows-msvc/msvc
76+
architecture: ARM64
77+
runner: windows-latest
78+
- target: x86_64-apple-darwin/clang
79+
architecture: x86_64
80+
runner: macos-13
81+
- target: aarch64-apple-darwin/clang
82+
architecture: aarch64
83+
runner: macos-14
84+
- target: x86_64-unknown-linux-gnu/gcc
85+
architecture: x86_64
86+
runner: ubuntu-24.04
87+
- target: aarch64-unknown-linux-gnu/gcc
88+
architecture: aarch64
89+
runner: ubuntu-24.04-arm
90+
steps:
91+
- uses: actions/checkout@v4
92+
with:
93+
persist-credentials: false
94+
- uses: actions/setup-python@v5
95+
with:
96+
python-version: '3.11'
97+
98+
- name: Native Windows
99+
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
100+
run: |
101+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
102+
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
103+
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
104+
105+
# No tests (yet):
106+
- name: Emulated Windows
107+
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
108+
run: |
109+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
110+
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
111+
112+
# The `find` line is required as a result of https://github.com/actions/runner-images/issues/9966.
113+
# This is a bug in the macOS runner image where the pre-installed Python is installed in the same
114+
# directory as the Homebrew Python, which causes the build to fail for macos-13. This line removes
115+
# the symlink to the pre-installed Python so that the Homebrew Python is used instead.
116+
- name: Native macOS
117+
if: runner.os == 'macOS'
118+
run: |
119+
brew update
120+
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
121+
brew install llvm@${{ matrix.llvm }}
122+
export SDKROOT="$(xcrun --show-sdk-path)"
123+
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '' }}
124+
make all --jobs 4
125+
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
126+
127+
- name: Native Linux
128+
if: runner.os == 'Linux'
129+
run: |
130+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
131+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
132+
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '' }}
133+
make all --jobs 4
134+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
135+
136+
jit-with-disabled-gil:
137+
name: Free-Threaded (Debug)
138+
needs: interpreter
139+
runs-on: ubuntu-24.04
140+
strategy:
141+
matrix:
142+
llvm:
143+
- 19
144+
steps:
145+
- uses: actions/checkout@v4
146+
with:
147+
persist-credentials: false
148+
- uses: actions/setup-python@v5
149+
with:
150+
python-version: '3.11'
151+
- name: Build with JIT enabled and GIL disabled
152+
run: |
153+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
154+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
155+
./configure --enable-experimental-jit --with-pydebug --disable-gil
156+
make all --jobs 4
157+
- name: Run tests
158+
run: |
159+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: new-bugs-announce notifier
2+
3+
on:
4+
issues:
5+
types:
6+
- opened
7+
8+
permissions:
9+
issues: read
10+
11+
jobs:
12+
notify-new-bugs-announce:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 10
15+
steps:
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
- run: npm install mailgun.js form-data
20+
- name: Send notification
21+
uses: actions/github-script@v7
22+
env:
23+
MAILGUN_API_KEY: ${{ secrets.MAILGUN_PYTHON_ORG_MAILGUN_KEY }}
24+
with:
25+
script: |
26+
const Mailgun = require("mailgun.js");
27+
const formData = require('form-data');
28+
const mailgun = new Mailgun(formData);
29+
const DOMAIN = "mailgun.python.org";
30+
const mg = mailgun.client({username: 'api', key: process.env.MAILGUN_API_KEY});
31+
github.rest.issues.get({
32+
issue_number: context.issue.number,
33+
owner: context.repo.owner,
34+
repo: context.repo.repo,
35+
})
36+
.then(function(issue) {
37+
const payload = {
38+
author : issue.data.user.login,
39+
issue : issue.data.number,
40+
title : issue.data.title,
41+
url : issue.data.html_url,
42+
labels : issue.data.labels.map(label => { return label.name }).join(", "),
43+
assignee : issue.data.assignees.map(assignee => { return assignee.login }),
44+
// We need to truncate the body size, because the max size for
45+
// the whole payload is 16kb. We want to be safe and assume that
46+
// body can take up to ~8kb of space.
47+
body : issue.data.body.substring(0, 8000)
48+
};
49+
50+
const data = {
51+
from: "CPython Issues <[email protected]>",
52+
53+
subject: `[Issue ${issue.data.number}] ${issue.data.title}`,
54+
template: "new-github-issue",
55+
'o:tracking-clicks': 'no',
56+
'h:X-Mailgun-Variables': JSON.stringify(payload)
57+
};
58+
return mg.messages.create(DOMAIN, data)
59+
})
60+
.then(msg => console.log(msg));
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
apt-get update
3+
4+
apt-get -yq install \
5+
build-essential \
6+
pkg-config \
7+
ccache \
8+
gdb \
9+
lcov \
10+
libb2-dev \
11+
libbz2-dev \
12+
libffi-dev \
13+
libgdbm-dev \
14+
libgdbm-compat-dev \
15+
liblzma-dev \
16+
libncurses5-dev \
17+
libreadline6-dev \
18+
libsqlite3-dev \
19+
libssl-dev \
20+
lzma \
21+
lzma-dev \
22+
strace \
23+
tk-dev \
24+
uuid-dev \
25+
xvfb \
26+
zlib1g-dev
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Update GH projects
2+
3+
on:
4+
issues:
5+
types:
6+
- opened
7+
- labeled
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
add-to-project:
14+
name: Add issues to projects
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 10
17+
strategy:
18+
matrix:
19+
include:
20+
# if an issue has any of these labels, it will be added
21+
# to the corresponding project
22+
- { project: 2, label: "release-blocker, deferred-blocker" }
23+
- { project: 32, label: sprint }
24+
25+
steps:
26+
- uses: actions/[email protected]
27+
with:
28+
project-url: https://github.com/orgs/python/projects/${{ matrix.project }}
29+
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
30+
labeled: ${{ matrix.label }}

.github/workflows/regen-abidump.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
set -ex
2+
3+
export DEBIAN_FRONTEND=noninteractive
4+
./.github/workflows/posix-deps-apt.sh
5+
apt-get install -yq abigail-tools python3
6+
export CFLAGS="-g3 -O0"
7+
./configure --enable-shared && make
8+
make regen-abidump

0 commit comments

Comments
 (0)