Add WAMR API bindings in Python (#1959)
Before adding the new bindings: 1. Moved wasm-c-api in a subfolder wasmcapi in the package. 2. Adapted the tests to be able to run in this new structure. New: 1. Added the WAMR API in another folder wamrapi in the same level as wasm-c-api. 2. Created an OOP proposal. 3. Added an example using this proposal.
This commit is contained in:
@ -8,7 +8,28 @@
|
||||
# pylint: disable=missing-function-docstring
|
||||
# pylint: disable=missing-module-docstring
|
||||
|
||||
from setuptools import setup, find_packages
|
||||
import pathlib
|
||||
from setuptools import setup
|
||||
from setuptools.command.develop import develop
|
||||
from setuptools.command.install import install
|
||||
from subprocess import check_call
|
||||
|
||||
|
||||
def build_library():
|
||||
cur_path = pathlib.Path(__file__).parent
|
||||
check_call(f"{cur_path}/utils/create_lib.sh".split())
|
||||
|
||||
class PreDevelopCommand(develop):
|
||||
"""Pre-installation for development mode."""
|
||||
def run(self):
|
||||
build_library()
|
||||
develop.run(self)
|
||||
|
||||
class PreInstallCommand(install):
|
||||
"""Pre-installation for installation mode."""
|
||||
def run(self):
|
||||
build_library()
|
||||
install.run(self)
|
||||
|
||||
|
||||
with open("README.md") as f:
|
||||
@ -24,7 +45,11 @@ setup(
|
||||
long_description=readme,
|
||||
author="The WAMR Project Developers",
|
||||
author_email="hello@bytecodealliance.org",
|
||||
url="https://github.com/bytecodealliance/wamr-python",
|
||||
url="https://github.com/bytecodealliance/wasm-micro-runtime",
|
||||
license=license,
|
||||
packages=["wamr"],
|
||||
include_package_data=True,
|
||||
cmdclass={
|
||||
'develop': PreDevelopCommand,
|
||||
'install': PreInstallCommand,
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user