Skip to content

Commit 8ee1d5a

Browse files
authored
Merge branch 'main' into docs-and-tests-of-inspect-fixes-updates-improvements
2 parents 5e7ce51 + 5901d92 commit 8ee1d5a

File tree

4 files changed

+25
-33
lines changed

4 files changed

+25
-33
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -242,31 +242,20 @@ jobs:
242242
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14"]'
243243

244244
build_ubuntu:
245-
name: 'Ubuntu'
246-
needs: check_source
247-
if: needs.check_source.outputs.run_tests == 'true'
248-
uses: ./.github/workflows/reusable-ubuntu.yml
249-
with:
250-
config_hash: ${{ needs.check_source.outputs.config_hash }}
251-
options: |
252-
../cpython-ro-srcdir/configure \
253-
--config-cache \
254-
--with-pydebug \
255-
--with-openssl=$OPENSSL_DIR
256-
257-
build_ubuntu_free_threading:
258-
name: 'Ubuntu (free-threading)'
245+
name: >-
246+
Ubuntu
247+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
259248
needs: check_source
260249
if: needs.check_source.outputs.run_tests == 'true'
250+
strategy:
251+
matrix:
252+
free-threading:
253+
- false
254+
- true
261255
uses: ./.github/workflows/reusable-ubuntu.yml
262256
with:
263257
config_hash: ${{ needs.check_source.outputs.config_hash }}
264-
options: |
265-
../cpython-ro-srcdir/configure \
266-
--config-cache \
267-
--with-pydebug \
268-
--with-openssl=$OPENSSL_DIR \
269-
--disable-gil
258+
free-threading: ${{ matrix.free-threading }}
270259

271260
build_ubuntu_ssltests:
272261
name: 'Ubuntu SSL tests with OpenSSL'
@@ -578,7 +567,6 @@ jobs:
578567
- build_macos
579568
- build_macos_free_threading
580569
- build_ubuntu
581-
- build_ubuntu_free_threading
582570
- build_ubuntu_ssltests
583571
- build_wasi
584572
- build_windows
@@ -613,7 +601,6 @@ jobs:
613601
build_macos,
614602
build_macos_free_threading,
615603
build_ubuntu,
616-
build_ubuntu_free_threading,
617604
build_ubuntu_ssltests,
618605
build_wasi,
619606
build_windows,

.github/workflows/reusable-ubuntu.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ on:
44
config_hash:
55
required: true
66
type: string
7-
options:
8-
required: true
9-
type: string
7+
free-threading:
8+
description: Whether to use free-threaded mode
9+
required: false
10+
type: boolean
11+
default: false
1012

1113
jobs:
1214
build_ubuntu_reusable:
@@ -63,7 +65,12 @@ jobs:
6365
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
6466
- name: Configure CPython out-of-tree
6567
working-directory: ${{ env.CPYTHON_BUILDDIR }}
66-
run: ${{ inputs.options }}
68+
run: >-
69+
../cpython-ro-srcdir/configure
70+
--config-cache
71+
--with-pydebug
72+
--with-openssl=$OPENSSL_DIR
73+
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
6774
- name: Build CPython out-of-tree
6875
working-directory: ${{ env.CPYTHON_BUILDDIR }}
6976
run: make -j4

Include/pymacro.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
// MSVC makes static_assert a keyword in C11-17, contrary to the standards.
1616
//
1717
// In C++11 and C2x, static_assert is a keyword, redefining is undefined
18-
// behaviour. So only define if building as C (if __STDC_VERSION__ is defined),
19-
// not C++, and only for C11-17.
18+
// behaviour. So only define if building as C, not C++ (if __cplusplus is
19+
// not defined), and only for C11-17.
2020
#if !defined(static_assert) && (defined(__GNUC__) || defined(__clang__)) \
21-
&& defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
22-
&& __STDC_VERSION__ <= 201710L
21+
&& !defined(__cplusplus) && defined(__STDC_VERSION__) \
22+
&& __STDC_VERSION__ >= 201112L && __STDC_VERSION__ <= 201710L
2323
# define static_assert _Static_assert
2424
#endif
2525

@@ -47,7 +47,7 @@
4747
#define Py_CHARMASK(c) ((unsigned char)((c) & 0xff))
4848

4949
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
50-
&& !defined(_MSC_VER))
50+
&& !defined(__cplusplus) && !defined(_MSC_VER))
5151
# define Py_BUILD_ASSERT_EXPR(cond) \
5252
((void)sizeof(struct { int dummy; _Static_assert(cond, #cond); }), \
5353
0)

Lib/test/test_pathlib/test_pathlib.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,6 @@ def test_rmtree_unwritable(self):
904904
errors = []
905905
tmp.rmtree(on_error=errors.append)
906906
# Test whether onerror has actually been called.
907-
print(errors)
908907
self.assertEqual(len(errors), 3)
909908
finally:
910909
tmp.chmod(old_dir_mode)
@@ -1006,7 +1005,6 @@ def close(fd):
10061005

10071006
with swap_attr(os, 'close', close) as orig_close:
10081007
dir1.rmtree(on_error=errors.append)
1009-
print(errors)
10101008
self.assertEqual(len(errors), 2)
10111009
self.assertEqual(errors[0].filename, str(dir2))
10121010
self.assertEqual(errors[1].filename, str(dir1))

0 commit comments

Comments
 (0)