Skip to content

Commit

Permalink
Merge branch 'main' into docs-and-tests-of-inspect-fixes-updates-impr…
Browse files Browse the repository at this point in the history
…ovements
  • Loading branch information
zuo authored Jul 21, 2024
2 parents 5e7ce51 + 5901d92 commit 8ee1d5a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 33 deletions.
31 changes: 9 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,31 +242,20 @@ jobs:
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14"]'

build_ubuntu:
name: 'Ubuntu'
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
uses: ./.github/workflows/reusable-ubuntu.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
options: |
../cpython-ro-srcdir/configure \
--config-cache \
--with-pydebug \
--with-openssl=$OPENSSL_DIR
build_ubuntu_free_threading:
name: 'Ubuntu (free-threading)'
name: >-
Ubuntu
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
strategy:
matrix:
free-threading:
- false
- true
uses: ./.github/workflows/reusable-ubuntu.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
options: |
../cpython-ro-srcdir/configure \
--config-cache \
--with-pydebug \
--with-openssl=$OPENSSL_DIR \
--disable-gil
free-threading: ${{ matrix.free-threading }}

build_ubuntu_ssltests:
name: 'Ubuntu SSL tests with OpenSSL'
Expand Down Expand Up @@ -578,7 +567,6 @@ jobs:
- build_macos
- build_macos_free_threading
- build_ubuntu
- build_ubuntu_free_threading
- build_ubuntu_ssltests
- build_wasi
- build_windows
Expand Down Expand Up @@ -613,7 +601,6 @@ jobs:
build_macos,
build_macos_free_threading,
build_ubuntu,
build_ubuntu_free_threading,
build_ubuntu_ssltests,
build_wasi,
build_windows,
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/reusable-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
config_hash:
required: true
type: string
options:
required: true
type: string
free-threading:
description: Whether to use free-threaded mode
required: false
type: boolean
default: false

jobs:
build_ubuntu_reusable:
Expand Down Expand Up @@ -63,7 +65,12 @@ jobs:
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
- name: Configure CPython out-of-tree
working-directory: ${{ env.CPYTHON_BUILDDIR }}
run: ${{ inputs.options }}
run: >-
../cpython-ro-srcdir/configure
--config-cache
--with-pydebug
--with-openssl=$OPENSSL_DIR
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
- name: Build CPython out-of-tree
working-directory: ${{ env.CPYTHON_BUILDDIR }}
run: make -j4
Expand Down
10 changes: 5 additions & 5 deletions Include/pymacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
// MSVC makes static_assert a keyword in C11-17, contrary to the standards.
//
// In C++11 and C2x, static_assert is a keyword, redefining is undefined
// behaviour. So only define if building as C (if __STDC_VERSION__ is defined),
// not C++, and only for C11-17.
// behaviour. So only define if building as C, not C++ (if __cplusplus is
// not defined), and only for C11-17.
#if !defined(static_assert) && (defined(__GNUC__) || defined(__clang__)) \
&& defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
&& __STDC_VERSION__ <= 201710L
&& !defined(__cplusplus) && defined(__STDC_VERSION__) \
&& __STDC_VERSION__ >= 201112L && __STDC_VERSION__ <= 201710L
# define static_assert _Static_assert
#endif

Expand Down Expand Up @@ -47,7 +47,7 @@
#define Py_CHARMASK(c) ((unsigned char)((c) & 0xff))

#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
&& !defined(_MSC_VER))
&& !defined(__cplusplus) && !defined(_MSC_VER))
# define Py_BUILD_ASSERT_EXPR(cond) \
((void)sizeof(struct { int dummy; _Static_assert(cond, #cond); }), \
0)
Expand Down
2 changes: 0 additions & 2 deletions Lib/test/test_pathlib/test_pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,6 @@ def test_rmtree_unwritable(self):
errors = []
tmp.rmtree(on_error=errors.append)
# Test whether onerror has actually been called.
print(errors)
self.assertEqual(len(errors), 3)
finally:
tmp.chmod(old_dir_mode)
Expand Down Expand Up @@ -1006,7 +1005,6 @@ def close(fd):

with swap_attr(os, 'close', close) as orig_close:
dir1.rmtree(on_error=errors.append)
print(errors)
self.assertEqual(len(errors), 2)
self.assertEqual(errors[0].filename, str(dir2))
self.assertEqual(errors[1].filename, str(dir1))
Expand Down

0 comments on commit 8ee1d5a

Please sign in to comment.