diff options
author | Michael McGeagh <michael.mcgeagh@arm.com> | 2020-11-25 14:23:08 +0000 |
---|---|---|
committer | patrik.gustavsson <patrik.gustavsson@arm.com> | 2020-11-25 15:35:24 +0000 |
commit | 3adc1e44125dc42e04568a5da5f7a7a2af3909df (patch) | |
tree | a2f7fb0e7252ea9010cbc0aa95da87c3256a7677 /setup.py | |
parent | ef0c7fe4d8c4e4d8f0b5af08111c93df9476a857 (diff) | |
download | ethos-u-vela-3adc1e44125dc42e04568a5da5f7a7a2af3909df.tar.gz |
MLBEDSW-3457 Merge README and PYPI
Instead of maintaining two almost identical readme files, have setup.py
read in the canonical README.md and modify it to replace the links
accordingly.
Signed-off-by: Michael McGeagh <michael.mcgeagh@arm.com>
Change-Id: Ia27cd48f3c945b3fac892ab1784ce394119968ac
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -15,6 +15,7 @@ # limitations under the License. # Description: # Packaging for the Vela compiler +import re from os import path from setuptools import Extension @@ -23,8 +24,14 @@ from setuptools import setup # Read the contents of README.md file this_directory = path.abspath(path.dirname(__file__)) -with open(path.join(this_directory, "PYPI.md"), encoding="utf-8") as f: +with open(path.join(this_directory, "README.md"), encoding="utf-8") as f: long_description = f.read() + # Replace local Markdown links with URLs + tag = "2.0.0" + url = f"https://review.mlplatform.org/plugins/gitiles/ml/ethos-u/ethos-u-vela/+/refs/tags/{tag}/" + for markdown in set(re.findall(r"\(.+\.md\)", long_description)): + link = f"({url}{markdown[1:-1]})" + long_description = long_description.replace(markdown, link) mlw_module = Extension( "ethosu.mlw_codec", |