Skip to content

Commit 4fd9ea6

Browse files
committed
Merge remote-tracking branch 'upstream/main' into move-magic-number
2 parents 2cc27f0 + afb0aa6 commit 4fd9ea6

Some content is hidden

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

47 files changed

+1176
-1020
lines changed

.github/workflows/build.yml

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -249,27 +249,38 @@ jobs:
249249
arch: ${{ matrix.arch }}
250250

251251
build_macos:
252-
name: 'macOS'
253-
needs: check_source
254-
if: needs.check_source.outputs.run_tests == 'true'
255-
uses: ./.github/workflows/reusable-macos.yml
256-
with:
257-
config_hash: ${{ needs.check_source.outputs.config_hash }}
258-
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
259-
# Cirrus used for upstream, macos-14 for forks.
260-
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14", "macos-13"]'
261-
262-
build_macos_free_threading:
263-
name: 'macOS (free-threading)'
252+
name: >-
253+
macOS
254+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
264255
needs: check_source
265256
if: needs.check_source.outputs.run_tests == 'true'
257+
strategy:
258+
fail-fast: false
259+
matrix:
260+
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
261+
# macOS 13 only runs tests against the GIL-enabled CPython.
262+
# Cirrus used for upstream, macos-14 for forks.
263+
os:
264+
- ghcr.io/cirruslabs/macos-runner:sonoma
265+
- macos-14
266+
- macos-13
267+
is-fork: # only used for the exclusion trick
268+
- ${{ github.repository_owner != 'python' }}
269+
free-threading:
270+
- false
271+
- true
272+
exclude:
273+
- os: ghcr.io/cirruslabs/macos-runner:sonoma
274+
is-fork: true
275+
- os: macos-14
276+
is-fork: false
277+
- os: macos-13
278+
free-threading: true
266279
uses: ./.github/workflows/reusable-macos.yml
267280
with:
268281
config_hash: ${{ needs.check_source.outputs.config_hash }}
269-
free-threading: true
270-
# Cirrus and macos-14 are M1.
271-
# Cirrus used for upstream, macos-14 for forks.
272-
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14"]'
282+
free-threading: ${{ matrix.free-threading }}
283+
os: ${{ matrix.os }}
273284

274285
build_ubuntu:
275286
name: >-
@@ -596,7 +607,6 @@ jobs:
596607
- check-docs
597608
- check_generated_files
598609
- build_macos
599-
- build_macos_free_threading
600610
- build_ubuntu
601611
- build_ubuntu_ssltests
602612
- build_wasi
@@ -632,7 +642,6 @@ jobs:
632642
&& '
633643
check_generated_files,
634644
build_macos,
635-
build_macos_free_threading,
636645
build_ubuntu,
637646
build_ubuntu_ssltests,
638647
build_wasi,

.github/workflows/reusable-macos.yml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ on:
88
required: false
99
type: boolean
1010
default: false
11-
os-matrix:
12-
required: false
11+
os:
12+
description: OS to run the job
13+
required: true
1314
type: string
1415

1516
jobs:
1617
build_macos:
17-
name: build and test (${{ matrix.os }})
18+
name: build and test (${{ inputs.os }})
1819
timeout-minutes: 60
1920
env:
2021
HOMEBREW_NO_ANALYTICS: 1
@@ -23,18 +24,7 @@ jobs:
2324
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
2425
PYTHONSTRICTEXTENSIONBUILD: 1
2526
TERM: linux
26-
strategy:
27-
fail-fast: false
28-
matrix:
29-
os: ${{fromJson(inputs.os-matrix)}}
30-
is-fork:
31-
- ${{ github.repository_owner != 'python' }}
32-
exclude:
33-
- os: "ghcr.io/cirruslabs/macos-runner:sonoma"
34-
is-fork: true
35-
- os: "macos-14"
36-
is-fork: false
37-
runs-on: ${{ matrix.os }}
27+
runs-on: ${{ inputs.os }}
3828
steps:
3929
- uses: actions/checkout@v4
4030
- name: Runner image version
@@ -43,7 +33,7 @@ jobs:
4333
uses: actions/cache@v4
4434
with:
4535
path: config.cache
46-
key: ${{ github.job }}-${{ matrix.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
36+
key: ${{ github.job }}-${{ inputs.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
4737
- name: Install Homebrew dependencies
4838
run: brew install pkg-config [email protected] xz gdbm tcl-tk
4939
- name: Configure CPython

Doc/library/dis.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,15 +1109,6 @@ iterations of the loop.
11091109
empty dictionary pre-sized to hold *count* items.
11101110

11111111

1112-
.. opcode:: BUILD_CONST_KEY_MAP (count)
1113-
1114-
The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the
1115-
top element on the stack which contains a tuple of keys, then starting from
1116-
``STACK[-2]``, pops *count* values to form values in the built dictionary.
1117-
1118-
.. versionadded:: 3.6
1119-
1120-
11211112
.. opcode:: BUILD_STRING (count)
11221113

11231114
Concatenates *count* strings from the stack and pushes the resulting string

Include/cpython/bytesobject.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ static inline Py_ssize_t PyBytes_GET_SIZE(PyObject *op) {
3131
return Py_SIZE(self);
3232
}
3333
#define PyBytes_GET_SIZE(self) PyBytes_GET_SIZE(_PyObject_CAST(self))
34+
35+
/* _PyBytes_Join(sep, x) is like sep.join(x). sep must be PyBytesObject*,
36+
x must be an iterable object. */
37+
PyAPI_FUNC(PyObject*) _PyBytes_Join(PyObject *sep, PyObject *x);

Include/internal/pycore_bytesobject.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ extern PyObject* _PyBytes_FromHex(
2323
PyAPI_FUNC(PyObject*) _PyBytes_DecodeEscape(const char *, Py_ssize_t,
2424
const char *, const char **);
2525

26-
/* _PyBytes_Join(sep, x) is like sep.join(x). sep must be PyBytesObject*,
27-
x must be an iterable object. */
28-
extern PyObject* _PyBytes_Join(PyObject *sep, PyObject *x);
29-
3026

3127
// Substring Search.
3228
//

Include/internal/pycore_opcode_metadata.h

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_stackref.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ extern "C" {
1111
#include "pycore_object_deferred.h"
1212

1313
#include <stddef.h>
14+
#include <stdbool.h>
1415

1516
/*
1617
This file introduces a new API for handling references on the stack, called
@@ -237,6 +238,38 @@ _PyObjectStack_FromStackRefStack(PyObject **dst, const _PyStackRef *src, size_t
237238
}
238239
}
239240

241+
// StackRef type checks
242+
243+
static inline bool
244+
PyStackRef_GenCheck(_PyStackRef stackref)
245+
{
246+
return PyGen_Check(PyStackRef_AsPyObjectBorrow(stackref));
247+
}
248+
249+
static inline bool
250+
PyStackRef_BoolCheck(_PyStackRef stackref)
251+
{
252+
return PyBool_Check(PyStackRef_AsPyObjectBorrow(stackref));
253+
}
254+
255+
static inline bool
256+
PyStackRef_LongCheck(_PyStackRef stackref)
257+
{
258+
return PyLong_Check(PyStackRef_AsPyObjectBorrow(stackref));
259+
}
260+
261+
static inline bool
262+
PyStackRef_ExceptionInstanceCheck(_PyStackRef stackref)
263+
{
264+
return PyExceptionInstance_Check(PyStackRef_AsPyObjectBorrow(stackref));
265+
}
266+
267+
268+
static inline bool
269+
PyStackRef_FunctionCheck(_PyStackRef stackref)
270+
{
271+
return PyFunction_Check(PyStackRef_AsPyObjectBorrow(stackref));
272+
}
240273

241274
#ifdef __cplusplus
242275
}

0 commit comments

Comments
 (0)