From: whitequark Date: Wed, 1 Jul 2020 20:49:41 +0000 (+0000) Subject: setup: link to the right documentation version from pip metadata. X-Git-Tag: 24jan2021_ls180~51 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d5d3bc4b1aba8dc0204268561c342b41c42c6617;p=nmigen.git setup: link to the right documentation version from pip metadata. --- diff --git a/setup.py b/setup.py index 3dafc3e..19f2518 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ from setuptools import setup, find_packages +from setuptools_scm.git import parse as parse_git def scm_version(): @@ -14,6 +15,14 @@ def scm_version(): } +def doc_version(): + git = parse_git(".") + if git.exact: + return git.format_with("{tag}") + else: + return "latest" + + setup( name="nmigen", use_scm_version=scm_version(), @@ -41,7 +50,7 @@ setup( ] }, project_urls={ - "Documentation": "https://nmigen.info/nmigen/", + "Documentation": "https://nmigen.info/nmigen/{}".format(doc_version()), "Source Code": "https://github.com/nmigen/nmigen", "Bug Tracker": "https://github.com/nmigen/nmigen/issues", },