Skip to content

Commit

Permalink
Merge pull request #71 from lazka/cython-test
Browse files Browse the repository at this point in the history
Add a cython test
  • Loading branch information
lazka committed Jul 6, 2024
2 parents 7e62011 + 6651996 commit 7d35b4d
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
${{ matrix.prefix }}-rust
${{ matrix.prefix }}-python
${{ matrix.prefix }}-python-setuptools
${{ matrix.prefix }}-cython
${{ matrix.prefix }}-autotools
${{ matrix.prefix }}-go
${{ matrix.prefix }}-ruby
Expand All @@ -74,6 +75,7 @@ jobs:
gcc
python
python-setuptools
cython
autotools
ruby
perl
Expand Down
4 changes: 4 additions & 0 deletions python/setuptools-cython/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/build
*.pyd
*.dll
*.c
2 changes: 2 additions & 0 deletions python/setuptools-cython/hello.pyx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def say_hello_to(name):
print(f"Hello {name}!")
8 changes: 8 additions & 0 deletions python/setuptools-cython/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from setuptools import setup
from Cython.Build import cythonize

setup(
name='cwrapper-cython',
version='1.0',
ext_modules=cythonize("hello.pyx", force=True, language_level=3),
)
3 changes: 3 additions & 0 deletions python/setuptools-cython/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import hello

hello.say_hello_to('world')
6 changes: 6 additions & 0 deletions python/setuptools-cython/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

set -e

CC=${CC:-cc} python setup.py build_ext --force --inplace
python test.py
1 change: 1 addition & 0 deletions python/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -e

(cd setuptools-cext && ./test.sh)
(cd setuptools-cython && ./test.sh)

if [[ "$MSYSTEM" == "MSYS" ]]; then
# Make sure python does not give away that we are not cygwin
Expand Down

0 comments on commit 7d35b4d

Please sign in to comment.