Skip to content

Commit d28fdfa

Browse files
Merge pull request #7 from roboflow-ai/version
added dynamic version number
2 parents 2b11be5 + ea9ad08 commit d28fdfa

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
import setuptools
22
from setuptools import find_packages
3+
import re
4+
5+
with open("./src/__init__.py", 'r') as f:
6+
content = f.read()
7+
# from https://www.py4u.net/discuss/139845
8+
version = re.search(r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', content).group(1)
39

410
with open("README.md", "r") as fh:
511
long_description = fh.read()
612

713
setuptools.setup(
814
name="template-python-zuppif",
9-
version="0.0.2",
15+
version=version,
1016
author="zuppif",
1117
author_email="[email protected]",
1218
description="<INSERT_DESCRIPTION>",

src/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.0.1"

0 commit comments

Comments
 (0)