Add version of the model method

This commit is contained in:
2021-12-17 11:01:09 +01:00
parent 08222f109e
commit 00ed57c015
5 changed files with 16 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
import setuptools
import os
def readme():
@@ -8,7 +9,8 @@ def readme():
def get_data(field):
item = ""
with open("stree/__init__.py") as f:
file_name = "_version.py" if field == "version" else "__init__.py"
with open(os.path.join("stree", file_name)) as f:
for line in f.readlines():
if line.startswith(f"__{field}__"):
delim = '"' if '"' in line else "'"