From 33f5c719bed4639ae2f24abad46396dd9f4e06df Mon Sep 17 00:00:00 2001 From: lipicoder Date: Thu, 1 Dec 2022 16:52:34 +0800 Subject: [PATCH] clean dirty --- src/magicbag/_version.py | 6 ++++++ tests/test_version.py | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 tests/test_version.py diff --git a/src/magicbag/_version.py b/src/magicbag/_version.py index 63e0065..1480217 100644 --- a/src/magicbag/_version.py +++ b/src/magicbag/_version.py @@ -261,6 +261,9 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command): "describe", "--tags", "--dirty", "--always", "--long", "--match", f"{tag_prefix}[[:digit:]]*" ], cwd=root) + print(f'describe_out: {describe_out}') + print(f'rc: {rc}') + # --long was added in git-1.5.5 if describe_out is None: raise NotThisMethod("'git describe' failed") @@ -642,11 +645,14 @@ def get_versions(): "date": None} try: + # print(f'tag prefix:{cfg.tag_prefix}') pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose) + # print(f"pieces: {pieces}") return render(pieces, cfg.style) except NotThisMethod: pass + print(f'cfg parent dir:{cfg.parentdir_prefix}') try: if cfg.parentdir_prefix: return versions_from_parentdir(cfg.parentdir_prefix, root, verbose) diff --git a/tests/test_version.py b/tests/test_version.py new file mode 100644 index 0000000..96f4af0 --- /dev/null +++ b/tests/test_version.py @@ -0,0 +1,8 @@ +"""Test versioneer.""" +from magicbag._version import get_versions + + +def test_version(): + """Test version.""" + versions = get_versions() + # print(f"versions:{versions}")