Skip to content

Commit

Permalink
adding versioning
Browse files Browse the repository at this point in the history
Signed-off-by: masadcv <[email protected]>
  • Loading branch information
masadcv committed Feb 9, 2024
1 parent 9d72a5c commit 3ab28e8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions FastGeodis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

from typing import List
import torch
from _version import __version__
import FastGeodisCpp


Expand Down
17 changes: 16 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@ def get_extensions():
]
return ext_modules

def get_version():
# following guidance from: https://stackoverflow.com/a/7071358
VERSIONFILE="FastGeodis/_version.py"
verstrline = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
if mo:
verstr = mo.group(1)
else:
raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,))
return verstr

# get current version
version = get_version()
print(f"FastGeodis building version: {version}")

with open("README.md", "r") as fh:
long_description = fh.read()
Expand All @@ -125,7 +140,7 @@ def get_extensions():

setup(
name="FastGeodis",
version="1.0.4",
version=version,
description="Fast Implementation of Generalised Geodesic Distance Transform for CPU (OpenMP) and GPU (CUDA)",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 3ab28e8

Please sign in to comment.