diff --git a/.gitignore b/.gitignore index 6a881cfe5c0c821cd6d5c03b1d617f43b3b4c557..d65161d1857d9b9d8b0e95b43506e0465a011c39 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ build */build */dist +dist diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..2b75dc0c2701dc419d619c18778241819605b4cf --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: python +python: + - "3.7" + - "3.8" +cache: pip +script: + - cd example + - python setup.py test +install: + - python setup.py install diff --git a/cython_multibuild/__init__.py b/cython_multibuild/__init__.py index e0a721d07e86436e4ed77f9281618e0f146e9b7e..0b4c785ca475c9b7d96ce3ffdc4cfe0f05d2402f 100644 --- a/cython_multibuild/__init__.py +++ b/cython_multibuild/__init__.py @@ -1,4 +1,4 @@ from .build import build from .multibuild import Multibuild -__version__ = '0.1' \ No newline at end of file +__version__ = '0.2' \ No newline at end of file diff --git a/cython_multibuild/build.py b/cython_multibuild/build.py index d8490516f2b92ff583e86974e2c0014d5ece3ea7..5ee6e7d2417224d72f6c1b23d51b8efa3bef16ca 100644 --- a/cython_multibuild/build.py +++ b/cython_multibuild/build.py @@ -1,8 +1,3 @@ -import logging -import typing as tp - -logger = logging.getLogger(__name__) - from Cython import Build old_cythonize = Build.cythonize @@ -13,4 +8,5 @@ def build(extensions, *args, **kwargs): multibuild.generate() return old_cythonize([ext.for_cythonize() for ext in extensions], *args, **kwargs) + Build.cythonize = build diff --git a/example/example_module/test3/__init__.py b/example/example_module/test3/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fa84e47ee529b348bfcf12c1c64433e3c127dde4 --- /dev/null +++ b/example/example_module/test3/__init__.py @@ -0,0 +1,5 @@ +import logging +import typing as tp + +logger = logging.getLogger(__name__) + diff --git a/example/example_module/test3/test3.pyx b/example/example_module/test3/test3.pyx new file mode 100644 index 0000000000000000000000000000000000000000..0d8accb9ca4f74e8aa170141d8cac94aa81c76d1 --- /dev/null +++ b/example/example_module/test3/test3.pyx @@ -0,0 +1,2 @@ +def times_four(x): + return x*4 diff --git a/example/tests/__init__.py b/example/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fa84e47ee529b348bfcf12c1c64433e3c127dde4 --- /dev/null +++ b/example/tests/__init__.py @@ -0,0 +1,5 @@ +import logging +import typing as tp + +logger = logging.getLogger(__name__) + diff --git a/example/tests/test_test.py b/example/tests/test_test.py new file mode 100644 index 0000000000000000000000000000000000000000..5d8dbc19e991b7c53a2e78272271ab3c8d111166 --- /dev/null +++ b/example/tests/test_test.py @@ -0,0 +1,15 @@ +from example_module.test import times_two +from example_module.test2 import times_three +from example_module.test3.test3 import times_four +import unittest + + +class TestExample(unittest.TestCase): + def test_two(self): + self.assertEqual(times_two(2), 4) + + def test_three(self): + self.assertEqual(times_three(2), 6) + + def test_four(self): + self.assertEqual(times_four(2), 8) diff --git a/setup.cfg b/setup.cfg index 1f60393ee605efb118e836091303b9a8ff8f3bbd..213d2ea076c60d693b35a4244115d434af3e62e5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,7 +7,7 @@ license_files = LICENSE author = Piotr MaĹlanka author_email = piotrm@smok.co description = Utilities for packing multiple pyx files into a single Cython extension -url = https://github.com/smok-serwis/multibuild +url = https://github.com/smok-serwis/cython-multibuild project-urls = Code = https://github.com/smok-serwis/cython-multibuild Issue tracker = https://github.com/smok-serwis/cython-multibuild/issues