Skip to content

Commit d93282a

Browse files
authored
Merge branch 'master' into issue-828
2 parents cdab7f0 + 2833d3e commit d93282a

15 files changed

Lines changed: 18660 additions & 135 deletions

.github/workflows/build.yml

Lines changed: 55 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -193,23 +193,13 @@ jobs:
193193
3.8.0,
194194
3.8.18,
195195
3.9.0,
196-
3.9.23,
196+
3.9.25,
197197
3.10.0,
198-
3.10.18,
198+
3.10.20,
199199
3.11.0,
200-
3.11.13,
200+
3.11.15,
201201
3.12.0,
202-
3.12.1,
203-
3.12.2,
204-
3.12.3,
205-
3.12.4,
206-
3.12.5,
207-
3.12.6,
208-
3.12.7,
209-
3.12.8,
210-
3.12.9,
211-
3.12.10,
212-
3.12.11,
202+
3.12.13,
213203
3.13.0,
214204
3.13.1,
215205
3.13.2,
@@ -218,76 +208,97 @@ jobs:
218208
3.13.5,
219209
3.13.6,
220210
3.13.7,
211+
3.13.8,
212+
3.13.9,
213+
3.13.10,
214+
3.13.11,
215+
3.13.12,
216+
3.13.13,
217+
3.14.0,
218+
3.14.1,
219+
3.14.2,
220+
3.14.3,
221+
3.14.4,
221222
]
222-
os: [ubuntu-22.04, macos-13, windows-latest, ubuntu-22.04-arm]
223+
os: [ubuntu-22.04, macos-latest, windows-latest, ubuntu-22.04-arm]
223224
# some versions of python can't be tested on GHA with osx because of SIP:
224225
exclude:
226+
- os: macos-latest
227+
python-version: 3.6.7
225228
- os: ubuntu-22.04
226229
python-version: 3.6.7
227230
- os: ubuntu-22.04-arm
228231
python-version: 3.6.7
232+
- os: macos-latest
233+
python-version: 3.6.15
229234
- os: windows-latest
230235
python-version: 3.6.15
231236
- os: ubuntu-22.04
232237
python-version: 3.6.15
233238
- os: ubuntu-22.04-arm
234239
python-version: 3.6.15
240+
- os: macos-latest
241+
python-version: 3.7.1
235242
- os: ubuntu-22.04
236243
python-version: 3.7.1
237244
- os: ubuntu-22.04-arm
238245
python-version: 3.7.1
246+
- os: macos-latest
247+
python-version: 3.7.17
239248
- os: windows-latest
240249
python-version: 3.7.17
241250
- os: ubuntu-22.04-arm
242251
python-version: 3.7.17
252+
- os: macos-latest
253+
python-version: 3.8.0
243254
- os: ubuntu-22.04
244255
python-version: 3.8.0
245256
- os: ubuntu-22.04-arm
246257
python-version: 3.8.0
258+
- os: macos-latest
259+
python-version: 3.8.18
247260
- os: windows-latest
248261
python-version: 3.8.18
262+
- os: macos-latest
263+
python-version: 3.9.0
249264
- os: ubuntu-22.04
250265
python-version: 3.9.0
251266
- os: ubuntu-22.04-arm
252267
python-version: 3.9.0
268+
- os: macos-latest
269+
python-version: 3.9.25
253270
- os: windows-latest
254-
python-version: 3.9.23
271+
python-version: 3.9.25
272+
- os: macos-latest
273+
python-version: 3.10.0
255274
- os: ubuntu-22.04
256275
python-version: 3.10.0
257276
- os: ubuntu-22.04-arm
258277
python-version: 3.10.0
278+
- os: macos-latest
279+
python-version: 3.10.20
259280
- os: windows-latest
260-
python-version: 3.10.18
261-
- os: macos-13
262-
python-version: 3.11.13
281+
python-version: 3.10.20
282+
- os: macos-latest
283+
python-version: 3.11.0
284+
- os: macos-latest
285+
python-version: 3.11.15
263286
- os: windows-latest
264-
python-version: 3.11.13
265-
- os: macos-13
287+
python-version: 3.11.15
288+
- os: macos-latest
266289
python-version: 3.12.0
267-
- os: macos-13
268-
python-version: 3.12.1
269-
- os: macos-13
270-
python-version: 3.12.2
271-
- os: macos-13
272-
python-version: 3.12.3
273-
- os: macos-13
274-
python-version: 3.12.4
275-
- os: macos-13
276-
python-version: 3.12.5
277-
- os: macos-13
278-
python-version: 3.12.6
279-
- os: macos-13
280-
python-version: 3.12.7
281-
- os: macos-13
282-
python-version: 3.12.8
283-
- os: macos-13
284-
python-version: 3.12.9
285-
- os: macos-13
286-
python-version: 3.12.10
287-
- os: macos-13
288-
python-version: 3.12.11
290+
- os: macos-latest
291+
python-version: 3.12.13
289292
- os: windows-latest
290-
python-version: 3.12.11
293+
python-version: 3.12.13
294+
- os: macos-latest
295+
python-version: 3.14.0
296+
- os: macos-latest
297+
python-version: 3.14.1
298+
- os: macos-latest
299+
python-version: 3.14.2
300+
- os: macos-latest
301+
python-version: 3.14.3
291302

292303
steps:
293304
- uses: actions/checkout@v5

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ py-spy is extremely low overhead: it is written in Rust for speed and doesn't ru
99
in the same process as the profiled Python program. This means py-spy is safe to use against production Python code.
1010

1111
py-spy works on Linux, OSX, Windows and FreeBSD, and supports profiling all recent versions of the CPython
12-
interpreter (versions 2.3-2.7 and 3.3-3.13).
12+
interpreter (versions 2.3-2.7 and 3.3-3.14).
1313

1414
## Installation
1515

ci/update_python_test_versions.py

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
import argparse
12
from collections import defaultdict
23
import requests
34
import pathlib
45
import yaml
56
import re
67

7-
88
_VERSIONS_URL = "https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json" # noqa
99

10+
_OSX_PYTHON_EXCLUSIONS = ["3.11.0", "3.12", "3.14.0", "3.14.1", "3.14.2", "3.14.3"]
11+
1012

1113
def parse_version(v):
1214
return tuple(int(part) for part in re.split(r"\W", v)[:3])
@@ -50,18 +52,18 @@ def get_github_python_versions():
5052

5153
# for older versions of python, don't test all patches
5254
# (just test first and last) to keep the test matrix down
53-
if major == 2 or minor <= 11:
55+
if major == 2 or minor <= 12:
5456
patches = [patches[0], patches[-1]]
5557

56-
if major == 3 and minor > 13:
58+
if major == 3 and minor > 14:
5759
continue
5860

5961
versions.extend(f"{major}.{minor}.{patch}" for patch in patches)
6062

6163
return versions, platforms
6264

6365

64-
def update_python_test_versions():
66+
def update_python_test_versions(force=False):
6567
versions, platforms = get_github_python_versions()
6668
versions = sorted(versions, key=parse_version)
6769

@@ -72,7 +74,8 @@ def update_python_test_versions():
7274
build_yml = yaml.safe_load(open(build_yml_path))
7375
test_matrix = build_yml["jobs"]["test-wheels"]["strategy"]["matrix"]
7476
existing_python_versions = test_matrix["python-version"]
75-
if versions == existing_python_versions:
77+
if not force and versions == existing_python_versions:
78+
print("No new python versions found - not updating github actions")
7679
return
7780

7881
print("Adding new versions")
@@ -96,9 +99,12 @@ def update_python_test_versions():
9699
# since it currently fails in GHA on SIP errors
97100
exclusions = []
98101
for v in versions:
99-
# if we don't have a python version for osx/windows skip
100-
if ("darwin", "x64") not in platforms[v] or v.startswith("3.12"):
101-
exclusions.append(" - os: macos-13\n")
102+
# if we don't have a python version for the platform, skip it in GHA
103+
# also, ignore python 3.12.* and 3.14.0 to 3.14.3 on OSX
104+
if ("darwin", "arm64") not in platforms[v] or any(
105+
v.startswith(pattern) for pattern in _OSX_PYTHON_EXCLUSIONS
106+
):
107+
exclusions.append(" - os: macos-latest\n")
102108
exclusions.append(f" python-version: {v}\n")
103109

104110
if ("win32", "x64") not in platforms[v]:
@@ -122,4 +128,15 @@ def update_python_test_versions():
122128

123129

124130
if __name__ == "__main__":
125-
update_python_test_versions()
131+
parser = argparse.ArgumentParser(
132+
description="Updates github actions with new python versions",
133+
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
134+
)
135+
parser.add_argument(
136+
"--force",
137+
help="Run script even if there are no new python versions",
138+
action="store_true",
139+
)
140+
args = parser.parse_args()
141+
142+
update_python_test_versions(force=args.force)

src/coredump.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ use crate::binary_parser::{parse_binary, BinaryInfo};
1515
use crate::config::Config;
1616
use crate::dump::print_trace;
1717
use crate::python_bindings::{
18-
v2_7_15, v3_10_0, v3_11_0, v3_12_0, v3_13_0, v3_3_7, v3_5_5, v3_6_6, v3_7_0, v3_8_0, v3_9_5,
18+
v2_7_15, v3_10_0, v3_11_0, v3_12_0, v3_13_0, v3_14_0, v3_3_7, v3_5_5, v3_6_6, v3_7_0, v3_8_0,
19+
v3_9_5,
1920
};
2021
use crate::python_data_access::format_variable;
2122
use crate::python_interpreters::InterpreterState;
@@ -318,6 +319,11 @@ impl PythonCoreDump {
318319
minor: 13,
319320
..
320321
} => self._get_stack::<v3_13_0::_is>(config),
322+
Version {
323+
major: 3,
324+
minor: 14,
325+
..
326+
} => self._get_stack::<v3_14_0::_is>(config),
321327
_ => Err(format_err!(
322328
"Unsupported version of Python: {}",
323329
self.version

src/dump.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use anyhow::Error;
1+
use anyhow::{Context, Error};
22
use console::{style, Term};
33

44
use crate::config::Config;
@@ -10,7 +10,9 @@ use remoteprocess::Pid;
1010
pub fn print_traces(pid: Pid, config: &Config, parent: Option<Pid>) -> Result<(), Error> {
1111
let mut process = PythonSpy::new(pid, config)?;
1212
if config.dump_json {
13-
let traces = process.get_stack_traces()?;
13+
let traces = process
14+
.get_stack_traces()
15+
.context("Failed to get stack traces")?;
1416
println!("{}", serde_json::to_string_pretty(&traces)?);
1517
return Ok(());
1618
}
@@ -36,7 +38,9 @@ pub fn print_traces(pid: Pid, config: &Config, parent: Option<Pid>) -> Result<()
3638
);
3739
}
3840
println!();
39-
let traces = process.get_stack_traces()?;
41+
let traces = process
42+
.get_stack_traces()
43+
.context("Failed to get stack traces")?;
4044
for trace in traces.iter().rev() {
4145
print_trace(trace, true);
4246
if config.subprocesses {

src/python_bindings/mod.rs

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pub mod v3_10_0;
33
pub mod v3_11_0;
44
pub mod v3_12_0;
55
pub mod v3_13_0;
6+
pub mod v3_14_0;
67
pub mod v3_3_7;
78
pub mod v3_5_5;
89
pub mod v3_6_6;
@@ -25,16 +26,6 @@ pub mod pyruntime {
2526
#[cfg(target_arch = "x86")]
2627
pub fn get_interp_head_offset(version: &Version) -> usize {
2728
match version {
28-
Version {
29-
major: 3,
30-
minor: 8,
31-
patch: 0,
32-
..
33-
} => match version.release_flags.as_ref() {
34-
"a1" | "a2" => 16,
35-
"a3" | "a4" => 20,
36-
_ => 24,
37-
},
3829
Version {
3930
major: 3,
4031
minor: 8..=10,
@@ -57,15 +48,6 @@ pub mod pyruntime {
5748
#[cfg(target_pointer_width = "64")]
5849
pub fn get_interp_head_offset(version: &Version) -> usize {
5950
match version {
60-
Version {
61-
major: 3,
62-
minor: 8,
63-
patch: 0,
64-
..
65-
} => match version.release_flags.as_ref() {
66-
"a1" | "a2" => 24,
67-
_ => 32,
68-
},
6951
Version {
7052
major: 3,
7153
minor: 8..=10,
@@ -81,8 +63,7 @@ pub mod pyruntime {
8163
}
8264

8365
// getting gilstate.tstate_current is different for all OS
84-
// and is also different for each python version, and even
85-
// between v3.8.0a1 and v3.8.0a2 =(
66+
// and is also different for each python version
8667
#[cfg(target_os = "macos")]
8768
pub fn get_tstate_current_offset(version: &Version) -> Option<usize> {
8869
match version {
@@ -95,17 +76,6 @@ pub mod pyruntime {
9576
Version {
9677
major: 3, minor: 7, ..
9778
} => Some(1528),
98-
Version {
99-
major: 3,
100-
minor: 8,
101-
patch: 0,
102-
..
103-
} => match version.release_flags.as_ref() {
104-
"a1" => Some(1432),
105-
"a2" => Some(888),
106-
"a3" | "a4" => Some(1448),
107-
_ => Some(1416),
108-
},
10979
Version {
11080
major: 3, minor: 8, ..
11181
} => Some(1416),
@@ -129,17 +99,6 @@ pub mod pyruntime {
12999
Version {
130100
major: 3, minor: 7, ..
131101
} => Some(796),
132-
Version {
133-
major: 3,
134-
minor: 8,
135-
patch: 0,
136-
..
137-
} => match version.release_flags.as_ref() {
138-
"a1" => Some(792),
139-
"a2" => Some(512),
140-
"a3" | "a4" => Some(800),
141-
_ => Some(788),
142-
},
143102
Version {
144103
major: 3, minor: 8, ..
145104
} => Some(788),

0 commit comments

Comments
 (0)