Skip to content

Commit 4084dbb

Browse files
authored
Merge pull request #6 from superannotateai/setup-py
Add get version
2 parents dc7ee41 + 9c74ebf commit 4084dbb

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

setup.py

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

46
this_directory = Path(__file__).parent
57
long_description = (this_directory / "README.md").read_text()
68

9+
def get_version():
10+
init = open(os.path.join(this_directory, 'src', 'superannotate_schemas', '__init__.py')).read()
11+
match = re.search(r'^__version__ = [\'"]([^\'"]+)[\'"]', init, re.M)
12+
if not match:
13+
raise RuntimeError('Unable to find version string.')
14+
return match.group(1)
715

816
setup(
917
name='superannotate_schemas',
1018
long_description=long_description,
1119
long_description_content_type='text/markdown',
12-
version='1.0.2b3',
20+
version=get_version(),
1321
package_dir={"": "src"},
1422
packages=find_packages(where="src"),
1523
description='SuperAnnotate JSON Schemas',

src/superannotate_schemas/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
from superannotate_schemas.validators import AnnotationValidators
88

99

10-
__version__ = "1.0.0"
11-
10+
__version__ = '1.0.24b'
1211

1312
__all__ = [
1413
"__version__",

0 commit comments

Comments
 (0)