aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Maier <brandon.maier@collins.com>2023-08-02 18:44:28 +0000
committerDavid Gibson <david@gibson.dropbear.id.au>2023-08-06 14:53:29 +1000
commitcd3e2304f4a9c4f725dcc548082ccc6c89d078a4 (patch)
tree49320c5861ee881126289a71d20ebdfb1ebd5672
parent0f5864567745c50e481b132538969b87259891e3 (diff)
downloaddtc-cd3e2304f4a9c4f725dcc548082ccc6c89d078a4.tar.gz
pylibfdt: use fallback version in tarballs
When building pylibfdt from the released tarballs[1] setup.py will fail with the following. > LookupError: setuptools-scm was unable to detect version for dtc. > Make sure you're either building from a fully intact git repository or > PyPI tarballs. Most other sources (such as GitHub's tarballs, a git > checkout without the .git folder) don't contain the necessary metadata > and will not work. seutptools_scm supports a 'fallback_version' that will use the provided string as the version when the git repo is not available. [1] https://www.kernel.org/pub/software/utils/dtc/dtc-1.7.0.tar.xz Signed-off-by: Brandon Maier <brandon.maier@collins.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rwxr-xr-xsetup.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index e82a832..c3ffb2b 100755
--- a/setup.py
+++ b/setup.py
@@ -22,6 +22,9 @@ srcdir = os.path.dirname(__file__)
with open(os.path.join(srcdir, "README.md"), "r") as fh:
long_description = fh.read()
+with open(os.path.join(srcdir, "VERSION.txt"), "r") as fh:
+ version = fh.readline().strip()
+
def get_top_builddir():
if '--top-builddir' in sys.argv:
index = sys.argv.index('--top-builddir')
@@ -51,6 +54,8 @@ setup(
name='libfdt',
use_scm_version={
"root": srcdir,
+ "fallback_version": version,
+ "fallback_root": srcdir,
},
cmdclass = {'build_py' : build_py},
setup_requires = ['setuptools_scm'],