From 74477ac5c97ebd9c9028a3a2af05caa315397018 Mon Sep 17 00:00:00 2001 From: paul-gatewood Date: Mon, 20 Nov 2023 00:54:42 -0700 Subject: [PATCH] Update setup.py to use Git versioning like FuseSoC (#400) Update setup.py to use Git versioning like FuseSoC --------- Co-authored-by: Paul Gatewood --- .gitignore | 3 +++ edalize/edatool.py | 1 + setup.py | 9 ++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 34676b70c..e59c42829 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ venv/ .project .pydevproject /.pytest_cache/ + +# auto-generated by setuptools_scm during the build +edalize/version.py diff --git a/edalize/edatool.py b/edalize/edatool.py index e865a0c90..44f7fd215 100644 --- a/edalize/edatool.py +++ b/edalize/edatool.py @@ -33,6 +33,7 @@ "ise_reporting", "vivado_reporting", "quartus_reporting", + "version", ] diff --git a/setup.py b/setup.py index d596b9923..9141bc8e1 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,10 @@ def read(fname): setup( name="edalize", - version="0.5.1", + use_scm_version={ + "relative_to": __file__, + "write_to": "edalize/version.py", + }, packages=["edalize", "edalize.tools", "edalize.flows"], package_data={ "edalize": [ @@ -84,6 +87,10 @@ def read(fname): "Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)", "Topic :: Utilities", ], + setup_requires=[ + "setuptools_scm < 7.0; python_version<'3.7'", + "setuptools_scm; python_version>='3.7'", + ], install_requires=[ "Jinja2>=3", ],