summaryrefslogtreecommitdiffstats
path: root/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/language-bindings/python/setup.py
blob: fb7993e683aca0931fd0bd947ce4a6a458692e88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# -*- coding: utf-8 -*-
#!/usr/bin/env python3
#
# Copyright (C) 2019 Intel Corporation.  All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# pylint: disable=missing-class-docstring
# pylint: disable=missing-function-docstring
# pylint: disable=missing-module-docstring

import pathlib
from setuptools import setup, find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
from setuptools.command.egg_info import egg_info
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):
    def run(self):
        build_library()
        develop.run(self)


class PreInstallCommand(install):
    def run(self):
        build_library()
        install.run(self)


class PreEggInfoCommand(egg_info):
    def run(self):
        build_library()
        egg_info.run(self)


with open("README.md") as f:
    readme = f.read()

with open("LICENSE") as f:
    license = f.read()

setup(
    name="wamr-python",
    version="0.1.0",
    description="A WebAssembly runtime powered by WAMR",
    long_description=readme,
    packages=find_packages(where="src"),
    package_dir={"": "src"},
    author="The WAMR Project Developers",
    author_email="hello@bytecodealliance.org",
    url="https://github.com/bytecodealliance/wasm-micro-runtime",
    license=license,
    include_package_data=True,
    cmdclass={
        'develop': PreDevelopCommand,
        'install': PreInstallCommand,
        'egg_info': PreEggInfoCommand,
    },
)