From 54d4e1ab22ed64b293ca640ab32e7cb42dd780e6 Mon Sep 17 00:00:00 2001 From: "Gabriele N. Tornetta" Date: Mon, 28 Aug 2023 09:09:42 +0100 Subject: [PATCH] ci: test with CPython latest sources --- .github/workflows/tests.yml | 32 ++++++++++++++++++++++++++++++++ echion/mirrors.h | 5 ++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 21648d3..48e1c10 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,6 +44,38 @@ jobs: # env: # CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} + tests-linux-python-src: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + + name: Tests with Python 3.13 on ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + + - name: Checkout Python repository + uses: actions/checkout@v2 + with: + repository: vstinner/cpython + ref: dict_struct + path: cpython + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install libunwind-dev lzma-dev + pip install hatch + + - name: Compile and install Python + run: | + cd cpython + ./configure + make -j 2 + sudo make install + + - name: Run tests + run: sudo -E env PATH="$PATH" hatch -e "tests.py3.13" run tests + tests-macos: runs-on: macos-latest strategy: diff --git a/echion/mirrors.h b/echion/mirrors.h index 01f8cc1..7ac43f4 100644 --- a/echion/mirrors.h +++ b/echion/mirrors.h @@ -9,7 +9,10 @@ #include #include -#if PY_VERSION_HEX >= 0x030b0000 +#if PY_VERSION_HEX >= 0x030d0000 +#define Py_BUILD_CORE +#include +#elif PY_VERSION_HEX >= 0x030b0000 #define Py_BUILD_CORE #include #else