From: Cesar Strauss Date: Wed, 17 May 2023 00:41:31 +0000 (+0000) Subject: Avoid depending on a newer setuptool version X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0b606145a2febf3ea93a5f345a316a147f74ac73;p=gram.git 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. --- 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*")),