From 0b606145a2febf3ea93a5f345a316a147f74ac73 Mon Sep 17 00:00:00 2001 From: Cesar Strauss Date: Wed, 17 May 2023 00:41:31 +0000 Subject: [PATCH] Avoid depending on a newer setuptool version "fallback_version" is not recognized on earlier setuptools. Instead of requiring a newer version, adopt the approach from lambdasoc's setup.py, which doesn't use this feature. --- setup.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 89c5dab..2243981 100755 --- a/setup.py +++ b/setup.py @@ -4,6 +4,18 @@ from setuptools import setup from setuptools import find_packages +def scm_version(): + def local_scheme(version): + if version.tag and not version.distance: + return version.format_with("") + else: + return version.format_choice("+{node}", "+{node}.dirty") + return { + "relative_to": __file__, + "version_scheme": "guess-next-dev", + "local_scheme": local_scheme + } + setup( # Vitals name="gram", @@ -13,14 +25,7 @@ setup( author="LambdaConcept", author_email="contact@lambdaconcept.com", description="DRAM core for LambdaSoC", - use_scm_version= { - "root": '..', - "relative_to": __file__, - "version_scheme": "guess-next-dev", - "local_scheme": lambda version : version.format_choice("+{node}", "+{node}.dirty"), - "fallback_version": "r0.0" - }, - + use_scm_version=scm_version(), # Imports / exports / requirements platforms='any', packages=find_packages(exclude=("test*", "doc*", "examples*", "contrib*", "libgram*")), -- 2.30.2