blob: f5f82bd085e6b481010f8ce878ba709347200b99 [file] [log] [blame]
Tim Hall79d07d22020-04-27 18:20:16 +01001# Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved.
2#
3# SPDX-License-Identifier: Apache-2.0
4#
5# Licensed under the Apache License, Version 2.0 (the License); you may
6# not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an AS IS BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Tim Hall79d07d22020-04-27 18:20:16 +010016# Description:
17# Packaging for the Vela compiler
Michael McGeagh3adc1e42020-11-25 14:23:08 +000018import re
Tim Hall79d07d22020-04-27 18:20:16 +010019from os import path
Diego Russoe8a10452020-04-21 17:39:10 +010020
21from setuptools import Extension
22from setuptools import find_namespace_packages
23from setuptools import setup
Tim Hall79d07d22020-04-27 18:20:16 +010024
25# Read the contents of README.md file
26this_directory = path.abspath(path.dirname(__file__))
Michael McGeagh3adc1e42020-11-25 14:23:08 +000027with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
Tim Hall79d07d22020-04-27 18:20:16 +010028 long_description = f.read()
Michael McGeagh3adc1e42020-11-25 14:23:08 +000029 # Replace local Markdown links with URLs
30 tag = "2.0.0"
31 url = f"https://review.mlplatform.org/plugins/gitiles/ml/ethos-u/ethos-u-vela/+/refs/tags/{tag}/"
32 for markdown in set(re.findall(r"\(.+\.md\)", long_description)):
33 link = f"({url}{markdown[1:-1]})"
34 long_description = long_description.replace(markdown, link)
Tim Hall79d07d22020-04-27 18:20:16 +010035
36mlw_module = Extension(
37 "ethosu.mlw_codec",
38 ["ethosu/mlw_codec/mlw_encode.c", "ethosu/mlw_codec/mlw_decode.c", "ethosu/mlw_codec/mlw_codecmodule.c"],
39)
40
41setup(
42 name="ethos-u-vela",
43 use_scm_version=True,
Tim Halld13bd062020-11-12 23:29:25 +000044 description="Neural network model compiler for Arm Ethos-U NPUs",
Tim Hall79d07d22020-04-27 18:20:16 +010045 long_description=long_description,
46 long_description_content_type="text/markdown",
47 url="https://git.mlplatform.org/ml/ethos-u/ethos-u-vela.git/",
48 author="Arm Ltd.",
49 license="Apache License 2.0",
50 classifiers=[
Tim Halle76a5332020-06-23 09:52:07 +010051 "Development Status :: 5 - Production/Stable",
Tim Hall79d07d22020-04-27 18:20:16 +010052 "Intended Audience :: Developers",
53 "License :: OSI Approved :: Apache Software License",
54 "Operating System :: POSIX :: Linux",
55 "Programming Language :: C",
56 "Programming Language :: Python :: 3",
57 "Programming Language :: Python :: 3.6",
58 "Programming Language :: Python :: 3.7",
59 "Programming Language :: Python :: 3.8",
60 "Topic :: Scientific/Engineering :: Artificial Intelligence",
61 "Topic :: Software Development :: Compilers",
62 ],
63 keywords=["ethos-u", "vela compiler", "tflite", "npu"],
64 packages=find_namespace_packages(include=["ethosu.*"]),
65 python_requires="~=3.6", # We support only 3.6+
Tim Hall9dce04c2020-11-13 10:54:55 +000066 install_requires=["flatbuffers==1.11.0", "numpy>=1.16.6", "lxml>=4.5.1"],
Tim Hall79d07d22020-04-27 18:20:16 +010067 entry_points={"console_scripts": ["vela = ethosu.vela.vela:main"]},
68 ext_modules=[mlw_module],
69 setup_requires=["setuptools_scm"],
70)