Skip to content

Commit

Permalink
fix bug tag prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
EeroEternal committed Dec 1, 2022
1 parent 33f5c71 commit 095bc6f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 2 additions & 1 deletion doc/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ VCS = "git"
style = "pep440"
versionfile_source = "src/magicbag/_version.py"
versionfile_build = "magicbag/_version.py"
tag_prefix = "v"
tag_prefix = ""
parentdir_prefix = "magicbag-"
```
check source and build directory carefully
check tag_prefix not "v"


### setup.py config
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ VCS = "git"
style = "pep440"
versionfile_source = "src/magicbag/_version.py"
versionfile_build = "magicbag/_version.py"
tag_prefix = "v"
tag_prefix = ""
parentdir_prefix = "magicbag-"

[tool.isort]
Expand Down
8 changes: 1 addition & 7 deletions src/magicbag/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_config():
cfg = VersioneerConfig()
cfg.VCS = "git"
cfg.style = "pep440"
cfg.tag_prefix = "v"
cfg.tag_prefix = ""
cfg.parentdir_prefix = "magicbag-"
cfg.versionfile_source = "src/magicbag/_version.py"
cfg.verbose = False
Expand Down Expand Up @@ -261,9 +261,6 @@ 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")
Expand Down Expand Up @@ -645,14 +642,11 @@ 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)
Expand Down

0 comments on commit 095bc6f

Please sign in to comment.