diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d998cfa..0ce5e98 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -499,11 +499,12 @@ jobs: -o wasm3 - name: Test run: ./build/wasm3 ./test/wasi/test.wasm + build-python: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: [ 3.5, 3.6, 3.7, 3.8 ] steps: - uses: actions/checkout@v2 @@ -511,9 +512,11 @@ jobs: uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - - name: Build python module + - name: Build Python module run: | - pip install . + cd platforms/python + python setup.py sdist + pip install ./dist/wasm3-*.tar.gz - name: Test with pytest run: | pip install pytest diff --git a/platforms/python/.gitignore b/platforms/python/.gitignore new file mode 100644 index 0000000..445f32f --- /dev/null +++ b/platforms/python/.gitignore @@ -0,0 +1,2 @@ +dist/ +wasm3.egg-info/ diff --git a/platforms/python/MANIFEST.in b/platforms/python/MANIFEST.in new file mode 100644 index 0000000..a5bebad --- /dev/null +++ b/platforms/python/MANIFEST.in @@ -0,0 +1 @@ +graft m3/ diff --git a/platforms/python/m3 b/platforms/python/m3 new file mode 120000 index 0000000..5d0a190 --- /dev/null +++ b/platforms/python/m3 @@ -0,0 +1 @@ +../../source \ No newline at end of file diff --git a/setup.py b/platforms/python/setup.py similarity index 60% rename from setup.py rename to platforms/python/setup.py index 25b5d46..221d1a9 100644 --- a/setup.py +++ b/platforms/python/setup.py @@ -2,12 +2,12 @@ from setuptools import setup from distutils.core import Extension from glob import glob -SOURCES = glob('source/*.c') + ['platforms/python/m3module.c'] +SOURCES = glob('m3/*.c') + ['m3module.c'] setup( name='wasm3', version='0.0.1', ext_modules=[ - Extension('m3', sources=SOURCES, include_dirs=['source'], + Extension('m3', sources=SOURCES, include_dirs=['m3'], extra_compile_args=['-g', '-O0'])] -) \ No newline at end of file +)