Skip to content

Commit

Permalink
Fixes versioning by adopting a simple devN schema
Browse files Browse the repository at this point in the history
  • Loading branch information
darothen committed Aug 7, 2023
1 parent 00df76a commit c23bc7d
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,13 @@
from textwrap import dedent

MAJOR, MINOR, MICRO = 1, 3, 1
DEV_ITER = 0
DEV = True
VERSION = "{}.{}.{}".format(MAJOR, MINOR, MICRO)

# Correct versioning with git info if DEV
if DEV:
import subprocess

pipe = subprocess.Popen(
["git", "describe", "--always", "--match", "'v[0-9]*'"],
stdout=subprocess.PIPE,
)
so, err = pipe.communicate()

if pipe.returncode != 0:
# no git or something wrong with git (not in dir?)
warnings.warn(
"WARNING: Couldn't identify git revision, using generic version string"
)
VERSION += ".dev"
else:
git_rev = so.strip()
git_rev = git_rev.decode("ascii") # necessary for Python >= 3

VERSION += ".dev-" + format(git_rev)
VERSION = "{}.{}.dev{}".format(MAJOR, MINOR, DEV_ITER)
else:
VERSION = "{}.{}.{}".format(MAJOR, MINOR, MICRO)

extensions = [
# Numba AOT extension module
Expand Down

0 comments on commit c23bc7d

Please sign in to comment.