Skip to content

Commit

Permalink
Merge pull request #199 from eriknw/cython3
Browse files Browse the repository at this point in the history
Update to work with Cython 3.0
  • Loading branch information
eriknw authored Jul 21, 2023
2 parents 6fd41d2 + d092fc0 commit f402d74
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 17 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
- "pypy-3.6"
- "pypy-3.7"
- "pypy-3.8"
- "pypy-3.9"
- "pypy3.6"
- "pypy3.7"
- "pypy3.8"
# - "pypy3.9"
# - "pypy3.10"
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
#
# pys = ['cp36', 'cp37', 'cp38', 'cp39', 'cp310', 'cp311']
# pys_arm = ['cp38', 'cp39', 'cp310', 'cp311']
# pypys = ['pp37', 'pp38', 'pp39']
# pypys = ['pp37', 'pp38', 'pp39', 'pp310']
# SKIP = set() # {"pp37-manylinux_aarch64", "pp38-win_amd64"}
# combos = []
#
Expand Down Expand Up @@ -75,7 +75,8 @@ jobs:
- {"os": "macos", "build": "cp311-macosx_x86_64", "arch": "x86_64"}
- {"os": "macos", "build": "pp37-macosx_x86_64", "arch": "x86_64"}
- {"os": "macos", "build": "pp38-macosx_x86_64", "arch": "x86_64"}
- {"os": "macos", "build": "pp39-macosx_x86_64", "arch": "x86_64"}
# - {"os": "macos", "build": "pp39-macosx_x86_64", "arch": "x86_64"}
# - {"os": "macos", "build": "pp310-macosx_x86_64", "arch": "x86_64"}
- {"os": "ubuntu", "build": "cp36-manylinux_aarch64", "arch": "aarch64"}
- {"os": "ubuntu", "build": "cp36-manylinux_i686", "arch": "i686"}
- {"os": "ubuntu", "build": "cp36-manylinux_ppc64le", "arch": "ppc64le"}
Expand Down Expand Up @@ -143,9 +144,12 @@ jobs:
- {"os": "ubuntu", "build": "pp38-manylinux_aarch64", "arch": "aarch64"}
- {"os": "ubuntu", "build": "pp38-manylinux_i686", "arch": "i686"}
- {"os": "ubuntu", "build": "pp38-manylinux_x86_64", "arch": "x86_64"}
- {"os": "ubuntu", "build": "pp39-manylinux_aarch64", "arch": "aarch64"}
- {"os": "ubuntu", "build": "pp39-manylinux_i686", "arch": "i686"}
- {"os": "ubuntu", "build": "pp39-manylinux_x86_64", "arch": "x86_64"}
# - {"os": "ubuntu", "build": "pp39-manylinux_aarch64", "arch": "aarch64"}
# - {"os": "ubuntu", "build": "pp310-manylinux_aarch64", "arch": "aarch64"}
# - {"os": "ubuntu", "build": "pp39-manylinux_i686", "arch": "i686"}
# - {"os": "ubuntu", "build": "pp310-manylinux_i686", "arch": "i686"}
# - {"os": "ubuntu", "build": "pp39-manylinux_x86_64", "arch": "x86_64"}
# - {"os": "ubuntu", "build": "pp310-manylinux_x86_64", "arch": "x86_64"}
- {"os": "windows", "build": "cp36-win32", "arch": "x86"}
- {"os": "windows", "build": "cp36-win_amd64", "arch": "AMD64"}
- {"os": "windows", "build": "cp37-win32", "arch": "x86"}
Expand All @@ -160,7 +164,8 @@ jobs:
- {"os": "windows", "build": "cp311-win_amd64", "arch": "AMD64"}
- {"os": "windows", "build": "pp37-win_amd64", "arch": "AMD64"}
- {"os": "windows", "build": "pp38-win_amd64", "arch": "AMD64"}
- {"os": "windows", "build": "pp39-win_amd64", "arch": "AMD64"}
# - {"os": "windows", "build": "pp39-win_amd64", "arch": "AMD64"}
# - {"os": "windows", "build": "pp310-win_amd64", "arch": "AMD64"}

steps:
- name: Setup QEMU
Expand All @@ -177,7 +182,7 @@ jobs:
with:
python-version: "3.x"
- name: Build wheels
uses: pypa/cibuildwheel@v2.11.2
uses: pypa/cibuildwheel@v2.14.1
env:
CIBW_BUILD: ${{ matrix.build }}
CIBW_ARCHS: ${{ matrix.arch }}
Expand Down Expand Up @@ -232,7 +237,7 @@ jobs:
run: |
ls -al dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.6.4
uses: pypa/gh-action-pypi-publish@v1.8.8
if: startsWith(github.ref, 'refs/tags/')
with:
user: __token__
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test: inplace

clean:
rm -f cytoolz/*.c cytoolz/*.so cytoolz/*/*.c cytoolz/*/*.so
rm -rf build/ cytoolz/__pycache__/ cytoolz/*/__pycache__/
rm -rf build/ __pycache__/ cytoolz/__pycache__/ cytoolz/*/__pycache__/

curried:
sed -e 's/toolz/cytoolz/g' -e 's/itercytoolz/itertoolz/' \
Expand Down
4 changes: 2 additions & 2 deletions cytoolz/functoolz.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ cdef class curry:
cdef readonly dict keywords
cdef public object __doc__
cdef public object __name__
cdef public object __module__
cdef public object __qualname__
cdef object _module
cdef object _qualname


cpdef object memoize(object func, object cache=*, object key=*)
Expand Down
18 changes: 16 additions & 2 deletions cytoolz/functoolz.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,25 @@ cdef class curry:
self.keywords = kwargs if kwargs else _empty_kwargs()
self.__doc__ = getattr(func, '__doc__', None)
self.__name__ = getattr(func, '__name__', '<curry>')
self.__module__ = getattr(func, '__module__', None)
self.__qualname__ = getattr(func, '__qualname__', None)
self._module = getattr(func, '__module__', None)
self._qualname = getattr(func, '__qualname__', None)
self._sigspec = None
self._has_unknown_args = None

property __module__:
def __get__(self):
return self._module

def __set__(self, val):
self._module = val

property __qualname__:
def __get__(self):
return self._qualname

def __set__(self, val):
self._qualname = val

def __str__(self):
return str(self.func)

Expand Down

0 comments on commit f402d74

Please sign in to comment.