Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 1 | # 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 Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 16 | # Description: |
| 17 | # Packaging for the Vela compiler |
Michael McGeagh | 3adc1e4 | 2020-11-25 14:23:08 +0000 | [diff] [blame^] | 18 | import re |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 19 | from os import path |
Diego Russo | e8a1045 | 2020-04-21 17:39:10 +0100 | [diff] [blame] | 20 | |
| 21 | from setuptools import Extension |
| 22 | from setuptools import find_namespace_packages |
| 23 | from setuptools import setup |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 24 | |
| 25 | # Read the contents of README.md file |
| 26 | this_directory = path.abspath(path.dirname(__file__)) |
Michael McGeagh | 3adc1e4 | 2020-11-25 14:23:08 +0000 | [diff] [blame^] | 27 | with open(path.join(this_directory, "README.md"), encoding="utf-8") as f: |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 28 | long_description = f.read() |
Michael McGeagh | 3adc1e4 | 2020-11-25 14:23:08 +0000 | [diff] [blame^] | 29 | # 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 Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 35 | |
| 36 | mlw_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 | |
| 41 | setup( |
| 42 | name="ethos-u-vela", |
| 43 | use_scm_version=True, |
Tim Hall | d13bd06 | 2020-11-12 23:29:25 +0000 | [diff] [blame] | 44 | description="Neural network model compiler for Arm Ethos-U NPUs", |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 45 | 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 Hall | e76a533 | 2020-06-23 09:52:07 +0100 | [diff] [blame] | 51 | "Development Status :: 5 - Production/Stable", |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 52 | "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 Hall | 9dce04c | 2020-11-13 10:54:55 +0000 | [diff] [blame] | 66 | install_requires=["flatbuffers==1.11.0", "numpy>=1.16.6", "lxml>=4.5.1"], |
Tim Hall | 79d07d2 | 2020-04-27 18:20:16 +0100 | [diff] [blame] | 67 | entry_points={"console_scripts": ["vela = ethosu.vela.vela:main"]}, |
| 68 | ext_modules=[mlw_module], |
| 69 | setup_requires=["setuptools_scm"], |
| 70 | ) |