From 77bc028d724ad559362a5a169543aa68e94c79d4 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Wed, 3 Sep 2025 19:16:54 -0300 Subject: [PATCH 01/17] Add CI/CD workflows --- .github/workflows/build-and-test.yaml | 31 +++++++++++++++++++++++++++ .github/workflows/pr.yaml | 8 +++++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/build-and-test.yaml create mode 100644 .github/workflows/pr.yaml diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml new file mode 100644 index 0000000..d351dea --- /dev/null +++ b/.github/workflows/build-and-test.yaml @@ -0,0 +1,31 @@ +name: Build/Test + +jobs: + build: + name: Build the library and run tests + strategy: + matrix: + os: [ubuntu-latest, ubuntu-24.04, ubuntu-22.04, + ubuntu-24.04-arm, macos-latest, macos-14] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build and install library + run: | + sudo python3 setup.py install + + - name: Install pytest + run: | + if [[ "${{ matrix.os }}" =~ "ubuntu" ]]; then + sudo apt update + sudo apt install -y python3-pytest + else + sudo python3 -m ensurepip --upgrade + sudo pip3 install pytest + fi + + - name: Run tests + run: | + pytest . diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..6e045d5 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,8 @@ +name: PR + +on: + pull_request: + +jobs: + build: + uses: ./.github/workflows/build-and-test.yml From d9a884cc5ad0c6d4144a0fc42c534c74dea71f95 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Wed, 3 Sep 2025 19:19:11 -0300 Subject: [PATCH 02/17] Small fixes --- .github/workflows/build-and-test.yaml | 8 ++++++++ .github/workflows/pr.yaml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index d351dea..79a322d 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -1,5 +1,13 @@ name: Build/Test +on: + workflow_call: + workflow_dispatch: + inputs: + part: + required: false + default: '' + jobs: build: name: Build the library and run tests diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 6e045d5..0689df6 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -5,4 +5,4 @@ on: jobs: build: - uses: ./.github/workflows/build-and-test.yml + uses: ./.github/workflows/build-and-test.yaml From 800b0b25ffa73a96d28a0e80762d4215bde314d3 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Wed, 3 Sep 2025 19:21:22 -0300 Subject: [PATCH 03/17] Install dependencies before running setup.py --- .github/workflows/build-and-test.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 79a322d..d1a906d 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -20,20 +20,21 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Build and install library - run: | - sudo python3 setup.py install - - name: Install pytest run: | if [[ "${{ matrix.os }}" =~ "ubuntu" ]]; then sudo apt update - sudo apt install -y python3-pytest + sudo apt install -y python3-pytest cython3 else + sudo xcode-select --install sudo python3 -m ensurepip --upgrade - sudo pip3 install pytest + sudo pip3 install pytest Cython fi + - name: Build and install library + run: | + sudo python3 setup.py install + - name: Run tests run: | pytest . From 20c02a55107f311e25862cf2e86853cf648dd8f8 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Wed, 3 Sep 2025 19:23:18 -0300 Subject: [PATCH 04/17] Skip some stuff on macos --- .github/workflows/build-and-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index d1a906d..9c96637 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -15,6 +15,7 @@ jobs: matrix: os: [ubuntu-latest, ubuntu-24.04, ubuntu-22.04, ubuntu-24.04-arm, macos-latest, macos-14] + fail-fast: false runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -26,7 +27,6 @@ jobs: sudo apt update sudo apt install -y python3-pytest cython3 else - sudo xcode-select --install sudo python3 -m ensurepip --upgrade sudo pip3 install pytest Cython fi From 8b672f32e7bf908d704fa604435a8e0ae3c3ff89 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Wed, 3 Sep 2025 19:25:03 -0300 Subject: [PATCH 05/17] Indent properly --- .github/workflows/build-and-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 9c96637..4d820b3 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -15,7 +15,7 @@ jobs: matrix: os: [ubuntu-latest, ubuntu-24.04, ubuntu-22.04, ubuntu-24.04-arm, macos-latest, macos-14] - fail-fast: false + fail-fast: false runs-on: ${{ matrix.os }} steps: - name: Checkout From 618a120509ee45d923556495f9029b4238e0a0b7 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Wed, 3 Sep 2025 19:34:30 -0300 Subject: [PATCH 06/17] Use build_ext instead of build --- .github/workflows/build-and-test.yaml | 6 +++--- setup.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 4d820b3..331fd1f 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -21,18 +21,18 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Install pytest + - name: Install dependencies run: | if [[ "${{ matrix.os }}" =~ "ubuntu" ]]; then sudo apt update sudo apt install -y python3-pytest cython3 else - sudo python3 -m ensurepip --upgrade - sudo pip3 install pytest Cython + sudo brew install pytest cython fi - name: Build and install library run: | + python3 setup.py build_ext sudo python3 setup.py install - name: Run tests diff --git a/setup.py b/setup.py index ef9f7cf..c62861c 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import shutil import sys from setuptools import setup, Extension -from setuptools.command.build import build +from setuptools.command.build_ext import build_ext from Cython.Build import cythonize extension_modules = [ @@ -21,7 +21,7 @@ with open (os.path.join (base_path, "requirements.txt")) as reqs: requirements = reqs.read () -class CustomBuild(build): +class CustomBuild(build_ext): def run(self): super().run() suffix = '.dll' if 'win' in sys.platform.lower() else '.so' @@ -45,7 +45,7 @@ def run(self): test_suite = "tests", install_requires = requirements, zip_safe = False, - cmdclass = {'build': CustomBuild}, + cmdclass = {'build_ext': CustomBuild}, ext_modules = cythonize (extension_modules, include_path = include_dirs, language_level = 3, annotate = True, compiler_directives = {'embedsignature': True}), From dbfa6566d2f0af8170739749de07072fe42c0742 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Wed, 3 Sep 2025 19:52:30 -0300 Subject: [PATCH 07/17] Add compatibility guards --- .github/workflows/build-and-test.yaml | 2 +- zser/defs.h | 16 ++++++++++++++++ zser/zser.pyx | 18 +++++++++--------- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 331fd1f..8a0a97d 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -27,7 +27,7 @@ jobs: sudo apt update sudo apt install -y python3-pytest cython3 else - sudo brew install pytest cython + brew install pytest cython fi - name: Build and install library diff --git a/zser/defs.h b/zser/defs.h index e976192..8e4116b 100644 --- a/zser/defs.h +++ b/zser/defs.h @@ -27,6 +27,11 @@ STR_NEW (unsigned int code, size_t len, const void *ptr) b->length = len; b->hash = -1; b->state.compact = 0; + +#if PY_MINOR_VERSION <= 11 + b->state.ready = 1; +#endif + b->state.interned = 0; // SSTATE_NOT_INTERNED if (code == 3) { @@ -39,6 +44,14 @@ STR_NEW (unsigned int code, size_t len, const void *ptr) { b->state.ascii = 0; b->state.kind = code; + +#if PY_MINOR_VERSION <= 11 + if (code == sizeof (wchar_t)) + { + b->wstr = (wchar_t *)p->data.any; + c->wstr_length = b->length; + } +#endif } return ((PyObject *)p); @@ -52,6 +65,9 @@ STR_FINI (PyObject *obj) PyUnicodeObject *p = (PyUnicodeObject *)obj; p->data.any = NULL; p->_base.utf8 = NULL; +#if PY_MINOR_VERSION <= 11 + p->_base._base.wstr = NULL; +#endif } static int diff --git a/zser/zser.pyx b/zser/zser.pyx index d7f6ec5..849f7eb 100644 --- a/zser/zser.pyx +++ b/zser/zser.pyx @@ -105,7 +105,7 @@ cdef union fn_caster: # Special object used for detecting misses in dict lookups. cdef object _SENTINEL = object () -cdef inline bint _is_inline_code (unsigned int code) noexcept: +cdef inline bint _is_inline_code (unsigned int code) : return code <= tpcode.FLOAT64 cdef inline size_t _get_padding (size_t off, size_t size): @@ -1538,13 +1538,13 @@ cdef _ProxyStr_mul (x, y): TYPE_PATCH (ProxyStr, _ProxyStr_add, _ProxyStr_mod, _ProxyStr_mul) -cdef inline size_t _rotate_hash (size_t code, size_t nbits) noexcept: +cdef inline size_t _rotate_hash (size_t code, size_t nbits) : return (code << nbits) | (code >> (sizeof (size_t) * 8 - nbits)) -cdef inline size_t _mix_hash (size_t h1, size_t h2) noexcept: +cdef inline size_t _mix_hash (size_t h1, size_t h2) : return _rotate_hash (h1, 5) ^ h2 -cdef inline size_t _hash_buf (const void *ptr, size_t nbytes) noexcept: +cdef inline size_t _hash_buf (const void *ptr, size_t nbytes) : cdef size_t ret ret = nbytes @@ -1554,7 +1554,7 @@ cdef inline size_t _hash_buf (const void *ptr, size_t nbytes) noexcept: return ret if ret != 0 else WORD_MAX -cdef inline size_t _hash_str (str sobj) noexcept: +cdef inline size_t _hash_str (str sobj) : cdef unsigned int kind kind = STR_KIND (sobj) @@ -1562,7 +1562,7 @@ cdef inline size_t _hash_str (str sobj) noexcept: kind = 1 return _hash_buf (PyUnicode_DATA (sobj), len (sobj) * kind) -cdef inline size_t _hash_flt (double flt) noexcept: +cdef inline size_t _hash_flt (double flt) : cdef double ipart if modf (flt, &ipart) == 0: @@ -1624,7 +1624,7 @@ def xhash (obj, seed = 0): ####################################### -cdef inline Py_ssize_t _cfloat_diff (cfloat x, cfloat y) noexcept: +cdef inline Py_ssize_t _cfloat_diff (cfloat x, cfloat y) : cdef double ret ret = x - y @@ -1706,7 +1706,7 @@ cdef int _cnum_find_sorted (const unsigned char *ptr, size_t n, obj, @cy.cdivision (True) @cy.nogil -cdef size_t _find_hidx (hidx_type hidxs, size_t hval, size_t n) noexcept: +cdef size_t _find_hidx (hidx_type hidxs, size_t hval, size_t n) : cdef size_t i, step, tmp i = 0 @@ -1779,7 +1779,7 @@ cdef size_t _find_obj_by_hidx (hidx_type hidxs, size_t ix, size_t n, ################################ # Functions on sets. -cdef inline bint _cnum_lt (cnum x, cnum y) noexcept: +cdef inline bint _cnum_lt (cnum x, cnum y) : if cnum is double or cnum is float: return _cfloat_diff (x, y) < 0 else: From 393181f858be3932613463e37adc4810409bd0ab Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Wed, 3 Sep 2025 19:53:15 -0300 Subject: [PATCH 08/17] Use pytest-3 --- .github/workflows/build-and-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 8a0a97d..feea714 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -37,4 +37,4 @@ jobs: - name: Run tests run: | - pytest . + pytest-3 . From a0968217fe54c2d1f192f6da2d4271e4b2b6ddc7 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Wed, 3 Sep 2025 20:00:11 -0300 Subject: [PATCH 09/17] Use signed char for compatibility with ARM --- .github/workflows/build-and-test.yaml | 2 +- zser/zser.pyx | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index feea714..8a52690 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -27,7 +27,7 @@ jobs: sudo apt update sudo apt install -y python3-pytest cython3 else - brew install pytest cython + brew install pytest cython python-setuptools fi - name: Build and install library diff --git a/zser/zser.pyx b/zser/zser.pyx index 849f7eb..399445e 100644 --- a/zser/zser.pyx +++ b/zser/zser.pyx @@ -62,7 +62,7 @@ cdef size_t[6] _BASIC_SIZES = [sizeof (char), sizeof (short), # Basic types that may be stored inline in lists, sets, dicts and descriptors. ctypedef fused cnum: - char + signed char unsigned char short unsigned short @@ -131,7 +131,7 @@ cdef _pack_cnum (Packer xm, int code, cnum value, bint tag): def _pack_int (Packer xm, value, tag): if INT8_MIN <= value <= INT8_MAX: - _pack_cnum[char] (xm, tpcode.INT8, value, tag) + _pack_cnum[cy.schar] (xm, tpcode.INT8, value, tag) elif INT16_MIN <= value <= INT16_MAX: _pack_cnum[short] (xm, tpcode.INT16, value, tag) elif INT32_MIN <= value <= INT32_MAX: @@ -834,7 +834,7 @@ cdef class Proxy: cdef unsigned int ilen if code == tpcode.INT8: - return _cnum_unpack[char] (self, offset, 0) + return _cnum_unpack[cy.schar] (self, offset, 0) elif code == tpcode.INT16: return _cnum_unpack[short] (self, offset, 0) elif code == tpcode.INT32: @@ -989,7 +989,7 @@ cdef inline object _builtin_aadd_impl (cnum *ptr, object val): cdef inline object _builtin_aadd (void *buf, Py_ssize_t pos, object val, unsigned int code): if code == tpcode.INT8: - return _builtin_aadd_impl[char] (buf + pos, val) + return _builtin_aadd_impl[cy.schar] (buf + pos, val) elif code == tpcode.INT16: return _builtin_aadd_impl[short] (buf + pos, val) elif code == tpcode.INT32: @@ -1004,7 +1004,7 @@ cdef inline object _builtin_aadd (void *buf, Py_ssize_t pos, cdef object _builtin_acas (void *buf, Py_ssize_t pos, object exp, object nval, unsigned int code): if code == tpcode.INT8: - return _builtin_acas_impl[char] (buf + pos, exp, nval) + return _builtin_acas_impl[cy.schar] (buf + pos, exp, nval) elif code == tpcode.INT16: return _builtin_acas_impl[short] (buf + pos, exp, nval) elif code == tpcode.INT32: @@ -1920,7 +1920,7 @@ cdef class ProxySet: p2 = (ix2.proxy.base + ix2.offset) if ix1.code == tpcode.INT8: - _cnum_set_union[char] (p1, ix1.size, p2, ix2.size, out, 0) + _cnum_set_union[cy.schar] (p1, ix1.size, p2, ix2.size, out, 0) elif ix1.code == tpcode.INT16: _cnum_set_union[short] (p1, ix1.size, p2, ix2.size, out, 0) elif ix1.code == tpcode.INT32: @@ -1950,7 +1950,7 @@ cdef class ProxySet: p2 = (ix2.proxy.base + ix2.offset) if ix1.code == tpcode.INT8: - _cnum_set_intersection[char] (p1, ix1.size, p2, ix2.size, out, 0) + _cnum_set_intersection[cy.schar] (p1, ix1.size, p2, ix2.size, out, 0) elif ix1.code == tpcode.INT16: _cnum_set_intersection[short] (p1, ix1.size, p2, ix2.size, out, 0) elif ix1.code == tpcode.INT32: @@ -1980,7 +1980,7 @@ cdef class ProxySet: p2 = (ix2.proxy.base + ix2.offset) if ix1.code == tpcode.INT8: - _cnum_set_difference[char] (p1, ix1.size, p2, ix2.size, out, 0) + _cnum_set_difference[cy.schar] (p1, ix1.size, p2, ix2.size, out, 0) elif ix1.code == tpcode.INT16: _cnum_set_difference[short] (p1, ix1.size, p2, ix2.size, out, 0) elif ix1.code == tpcode.INT32: @@ -2010,7 +2010,7 @@ cdef class ProxySet: p2 = (ix2.proxy.base + ix2.offset) if ix1.code == tpcode.INT8: - _cnum_set_symdiff[char] (p1, ix1.size, p2, ix2.size, out, 0) + _cnum_set_symdiff[cy.schar] (p1, ix1.size, p2, ix2.size, out, 0) elif ix1.code == tpcode.INT16: _cnum_set_symdiff[short] (p1, ix1.size, p2, ix2.size, out, 0) elif ix1.code == tpcode.INT32: @@ -2042,7 +2042,7 @@ cdef class ProxySet: ptr = (proxy.base + indices.offset) if code == tpcode.INT8: - return _cnum_find_sorted[char] (ptr, n, value, 0, 0) + return _cnum_find_sorted[cy.schar] (ptr, n, value, 0, 0) elif code == tpcode.INT16: return _cnum_find_sorted[short] (ptr, n, value, 0, 0) elif code == tpcode.INT32: @@ -2211,7 +2211,7 @@ cdef class ProxySet: if ix1.size > ix2.size: ret = False elif self.indices.code == tpcode.INT8: - ret = _cnum_set_includes[char] (p2, ix2.size, p1, ix1.size, 0) + ret = _cnum_set_includes[cy.schar] (p2, ix2.size, p1, ix1.size, 0) elif self.indices.code == tpcode.INT16: ret = _cnum_set_includes[short] (p2, ix2.size, p1, ix1.size, 0) elif self.indices.code == tpcode.INT32: From 7168ec0a6a59a64d711e0c6e07a97938428e3c37 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Wed, 3 Sep 2025 20:08:09 -0300 Subject: [PATCH 10/17] More compatibility fixes for ARM --- .github/workflows/build-and-test.yaml | 2 ++ zser/zser.pyx | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 8a52690..2beb083 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -27,7 +27,9 @@ jobs: sudo apt update sudo apt install -y python3-pytest cython3 else + sudo python3 -m ensurepip --upgrade || true brew install pytest cython python-setuptools + pip install Cython fi - name: Build and install library diff --git a/zser/zser.pyx b/zser/zser.pyx index 399445e..e29e5d4 100644 --- a/zser/zser.pyx +++ b/zser/zser.pyx @@ -921,7 +921,7 @@ cdef class Proxy: cdef inline object _builtin_read (void *buf, Py_ssize_t pos, unsigned int code): if code == tpcode.INT8: - return (buf)[pos] + return (buf)[pos] elif code == tpcode.INT16: return (buf)[pos] elif code == tpcode.INT32: @@ -935,7 +935,7 @@ cdef inline object _builtin_read (void *buf, Py_ssize_t pos, cdef inline void _builtin_write (void *buf, Py_ssize_t pos, object obj, unsigned int code): if code == tpcode.INT8: - (buf)[pos] = obj + (buf)[pos] = obj elif code == tpcode.INT16: (buf)[pos] = obj elif code == tpcode.INT32: From ac5c11611f1518e4db977c5a39d77eaa254a2de2 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Wed, 3 Sep 2025 20:14:17 -0300 Subject: [PATCH 11/17] Try workaround for macos --- .github/workflows/build-and-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 2beb083..e059cad 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -29,7 +29,7 @@ jobs: else sudo python3 -m ensurepip --upgrade || true brew install pytest cython python-setuptools - pip install Cython + pip install --break-system-packages Cython fi - name: Build and install library From 260b7a53920076c90fc7770684cda43682a70974 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Wed, 3 Sep 2025 20:18:03 -0300 Subject: [PATCH 12/17] Use a different workaround for macos --- .github/workflows/build-and-test.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index e059cad..a653b42 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -27,9 +27,8 @@ jobs: sudo apt update sudo apt install -y python3-pytest cython3 else - sudo python3 -m ensurepip --upgrade || true - brew install pytest cython python-setuptools - pip install --break-system-packages Cython + brew install pipx + pipx install cython setuptools fi - name: Build and install library From 2163c267fd690c814f76bcb229db33c1bdd9a403 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Wed, 3 Sep 2025 20:21:35 -0300 Subject: [PATCH 13/17] More fixes for macos --- .github/workflows/build-and-test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index a653b42..b7f077f 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -27,8 +27,8 @@ jobs: sudo apt update sudo apt install -y python3-pytest cython3 else - brew install pipx - pipx install cython setuptools + brew install pipx pytest cython python-setuptools + pipx install cython fi - name: Build and install library From a3102be093f3406f0c57d8bc9d2932f7939e8377 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Wed, 3 Sep 2025 20:26:10 -0300 Subject: [PATCH 14/17] Download cython by hand in macos --- .github/workflows/build-and-test.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index b7f077f..a618126 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -27,8 +27,9 @@ jobs: sudo apt update sudo apt install -y python3-pytest cython3 else - brew install pipx pytest cython python-setuptools - pipx install cython + brew install pytest python-setuptools + git clone https://github.com/cython/cython.git + sudo python3 cython/setup.py install fi - name: Build and install library From f524d4bd76872372774b55cba365fd300163fa7a Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Wed, 3 Sep 2025 20:27:30 -0300 Subject: [PATCH 15/17] Run setup.py in directory --- .github/workflows/build-and-test.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index a618126..c6abe72 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -29,7 +29,9 @@ jobs: else brew install pytest python-setuptools git clone https://github.com/cython/cython.git - sudo python3 cython/setup.py install + cd cython + sudo python3 setup.py install + cd .. fi - name: Build and install library From 707854cc61cbe2653d86723f894fa188a87049f8 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Wed, 3 Sep 2025 20:30:57 -0300 Subject: [PATCH 16/17] Use a specific cython version --- .github/workflows/build-and-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index c6abe72..6bb48a9 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -28,7 +28,7 @@ jobs: sudo apt install -y python3-pytest cython3 else brew install pytest python-setuptools - git clone https://github.com/cython/cython.git + git clone --single-branch --branch 3.1.x https://github.com/cython/cython.git cd cython sudo python3 setup.py install cd .. From 3a8bd5ada1b03b159a770be4ab9b29ccfddd9ccd Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Wed, 3 Sep 2025 20:32:55 -0300 Subject: [PATCH 17/17] Remove macos tests --- .github/workflows/build-and-test.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 6bb48a9..c8cce1b 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -13,8 +13,7 @@ jobs: name: Build the library and run tests strategy: matrix: - os: [ubuntu-latest, ubuntu-24.04, ubuntu-22.04, - ubuntu-24.04-arm, macos-latest, macos-14] + os: [ubuntu-latest, ubuntu-24.04, ubuntu-22.04, ubuntu-24.04-arm] fail-fast: false runs-on: ${{ matrix.os }} steps: