object oriented path handling

This commit is contained in:
Martin Diehl 2020-07-15 21:58:24 +02:00
parent fa7f7e6fa4
commit 9225d439ab
2 changed files with 3 additions and 2 deletions

View File

@ -1,3 +1,4 @@
import os
import json
import functools

View File

@ -1,8 +1,8 @@
import setuptools
import os
from pathlib import Path
import re
with open(os.path.join(os.path.dirname(__file__),'damask/VERSION')) as f:
with open(Path(__file__).parent/'damask/VERSION') as f:
version = re.sub(r'(-([^-]*)).*$',r'.\2',re.sub(r'^v(\d+\.\d+(\.\d+)?)',r'\1',f.readline().strip()))
setuptools.setup(