From 5f6b36e91f44c43bd7073fc94be239e795a12128 Mon Sep 17 00:00:00 2001 From: Catherine Date: Wed, 22 Mar 2023 10:37:06 +0000 Subject: [PATCH] Add a workaround for python-poetry/poetry#7702. --- setup.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index d63e3f7..eb91960 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,18 @@ from setuptools import setup -from setuptools_scm.git import parse as parse_git def doc_version(): - git = parse_git(".") - if git.exact: - return git.format_with("v{tag}") - else: - return "latest" + try: + from setuptools_scm.git import parse as parse_git + git = parse_git(".") + if git.exact: + return git.format_with("v{tag}") + else: + return "latest" + except ImportError: + # PEP 517 compliant build tools will never reach this code path. + # Poetry reaches this code path. + return "" setup(