Skip to content

Commit a5bff5e

Browse files
committed
fix: missing version update
1 parent 96e1e1f commit a5bff5e

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

semantic_iot/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
from .RDF_generator import RDFGenerator
44

55

6-
__version__ = "0.1.0"
6+
__version__ = "0.2.1"

setup.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
from pathlib import Path
2+
import re
13
from setuptools import setup, find_packages
24
import os
35

6+
def get_version():
7+
"""Reads the version from your_package/__init__.py"""
8+
init_py = Path(__file__).parent.joinpath("semantic_iot", "__init__.py")
9+
with open(init_py, "r") as f:
10+
content = f.read()
11+
# Using a regular expression to find the version string
12+
match = re.search(r"^__version__\s*=\s*['\"]([^'\"]*)['\"]", content, re.M)
13+
if match:
14+
return match.group(1)
15+
raise RuntimeError("Unable to find version string.")
416

517
# Utility function to read the README file.
618
def read_long_description():
@@ -26,7 +38,7 @@ def read_requirements():
2638

2739
setup(
2840
name='semantic_iot',
29-
version='0.1.0', # Update the version as needed
41+
version=get_version(),
3042
author='Junsong Du',
3143
author_email='[email protected]',
3244
description='A semantic framework to enhence interoperability cross different '

0 commit comments

Comments
 (0)