Skip to content

Commit 8ddf0ed

Browse files
committed
fix version parsing in setup.py
1 parent b0f5a18 commit 8ddf0ed

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

setup.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
import re
2+
from pathlib import Path
3+
14
from setuptools import setup
25

3-
from fastapi_sqlalchemy import __version__ as version
6+
with open(Path("fastapi_sqlalchemy") / "__init__.py", encoding="utf-8") as fh:
7+
version = re.search(r'__version__ = "(.*?)"', fh.read(), re.M).group(1)
48

5-
with open("README.rst", encoding="utf-8") as f:
6-
long_description = f.read()
9+
with open("README.rst", encoding="utf-8") as fh:
10+
long_description = fh.read()
711

812
setup(
913
name="FastAPI-SQLAlchemy",

0 commit comments

Comments
 (0)