Skip to content

Commit 5d58993

Browse files
committed
setup.py: version is now obtained with a reg exp
1 parent b927c0a commit 5d58993

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

setup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
import re
12
from setuptools import setup, find_packages
23

3-
import openflow
4+
with open('openflow/__init__.py', 'r') as f:
5+
version = re.search(r"__version__ = '([\d\.]*)'", f.read()).group(1)
46

5-
with open('README.md', 'r') as fh:
6-
long_description = fh.read()
7+
with open('README.md', 'r') as f:
8+
long_description = f.read()
79

810
setup(
911
name='fpgaopenflow',
10-
version=openflow.__version__,
12+
version=version,
1113
description='a Python library, and CLI utilities, which solves HDL-to-bitstream based on FOSS',
1214
long_description=long_description,
1315
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)