From d5d3bc4b1aba8dc0204268561c342b41c42c6617 Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 1 Jul 2020 20:49:41 +0000 Subject: [PATCH] setup: link to the right documentation version from pip metadata. --- setup.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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", }, -- 2.30.2