From 1bc84d964aea89ea28d8e99e1ee9253215b0415d Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sun, 4 Apr 2021 14:04:55 -0400 Subject: [PATCH 1/4] Set __commit__ to an empty string for non-dev releases --- pygmt/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/__init__.py b/pygmt/__init__.py index 2aeb76d10a6..033a21f631b 100644 --- a/pygmt/__init__.py +++ b/pygmt/__init__.py @@ -47,7 +47,7 @@ # Get semantic version through setuptools-scm __version__ = f'v{get_distribution("pygmt").version}' # e.g. v0.1.2.dev3+g0ab3cd78 -__commit__ = __version__.split("+g")[-1] # 0ab3cd78 +__commit__ = __version__.split("+g")[-1] if "+g" in __version__ else "" # 0ab3cd78 # Start our global modern mode session _begin() From 6b42847bcefad3ded0356cd3238cf323eeeacee6 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sun, 4 Apr 2021 23:47:00 -0400 Subject: [PATCH 2/4] Set commit_link to an empty string if __commit__ is empty --- doc/conf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index fb47eab1d19..29a4ef637f8 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -150,7 +150,10 @@ html_theme_options = {} repository = "GenericMappingTools/pygmt" repository_url = "https://github.com/GenericMappingTools/pygmt" -commit_link = f'{ __commit__[:8] }' +if __commit__: + commit_link = f'{ __commit__[:8] }' +else: + commit_link = "" html_context = { "menu_links": [ ( From 0bf3bba8ba4f97b8eccd76b251fb7e172c325fcd Mon Sep 17 00:00:00 2001 From: actions-bot <58130806+actions-bot@users.noreply.github.com> Date: Mon, 5 Apr 2021 03:50:08 +0000 Subject: [PATCH 3/4] [format-command] fixes --- doc/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 29a4ef637f8..4d9faa8ec1c 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -151,7 +151,9 @@ repository = "GenericMappingTools/pygmt" repository_url = "https://github.com/GenericMappingTools/pygmt" if __commit__: - commit_link = f'{ __commit__[:8] }' + commit_link = ( + f'{ __commit__[:8] }' + ) else: commit_link = "" html_context = { From 7d589559e78ec66249680c14c5457f8a4499c74a Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 5 Apr 2021 00:15:06 -0400 Subject: [PATCH 4/4] Link to tags --- doc/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 4d9faa8ec1c..22c973073fb 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -155,7 +155,9 @@ f'{ __commit__[:8] }' ) else: - commit_link = "" + commit_link = ( + f'{ __version__ }' + ) html_context = { "menu_links": [ (