Skip to content

Commit 6e4368b

Browse files
authored
fix(version): make package version available after install (#61)
1 parent acce362 commit 6e4368b

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,4 +372,5 @@ DerivedData/
372372
*.pickle
373373

374374
# User created
375-
VERSION
375+
VERSION
376+
version.py

setup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1+
from fileinput import FileInput
12
from setuptools import setup, find_namespace_packages
23
from pathlib import Path
34

5+
46
here = Path(__file__).parent.resolve()
57

68
requirements = (here / "requirements.txt").read_text(encoding="utf8")
79
long_description = (here / 'README.md').read_text(encoding='utf-8')
810

911
version = (here / 'VERSION').read_text().rstrip("\n")
1012

13+
with open('src/ydata_synthetic/version.py', 'w') as version_file:
14+
version_file.write(f'__version__ = \'{version}\'')
15+
1116
setup(name='ydata-synthetic',
1217
version=version,
1318
description='Synthetic data generation methods with different synthetization methods.',

src/ydata_synthetic/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .version import __version__

0 commit comments

Comments
 (0)