Skip to content
Snippets Groups Projects
Commit e0494ae1 authored by calrama's avatar calrama
Browse files

Automatic package version

parent 17aff70f
Branches
Tags
1 merge request!7Fix #1
# SPDX-License-Identifier: LGPL-3.0-or-later # SPDX-License-Identifier: LGPL-3.0-or-later
from subprocess import run, PIPE
from setuptools import setup, find_packages from setuptools import setup, find_packages
...@@ -11,9 +13,32 @@ entry_points = { ...@@ -11,9 +13,32 @@ entry_points = {
"robofish-io-evaluate=robofish.evaluate.app:evaluate", "robofish-io-evaluate=robofish.evaluate.app:evaluate",
] ]
} }
def source_version():
version_parts = (
run(["git", "describe", "--tags", "--dirty"], check=True, stdout=PIPE, encoding="utf-8")
.stdout.strip()
.split("-")
)
if version_parts[-1] == "dirty":
dirty = True
version_parts = version_parts[:-1]
else:
dirty = False
version = version_parts[0]
if len(version_parts) == 3:
version += ".post0"
version += f".dev{version_parts[1]}+{version_parts[2]}"
if dirty:
version += "+dirty"
return version
setup( setup(
name="robofish-io", name="robofish-io",
version="0.1.1", version=source_version(),
author="", author="",
author_email="", author_email="",
install_requires=["h5py>=3", "numpy", "seaborn", "pandas", "deprecation"], install_requires=["h5py>=3", "numpy", "seaborn", "pandas", "deprecation"],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment