Skip to content

Commit

Permalink
Updated version searching regex in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
speratus committed Sep 11, 2019
1 parent 5107063 commit f5dc86e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/dist/
/__pycache__/
/blinkter/__pycache__/
/env/
/env/
/venv/
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@
from setuptools import setup, find_packages
import re

def get_property(prop: str, project: str):

def get_property(prop, project):
with open(project + '/__init__.py', 'r') as f:
return re.search(r'{}\s*=\s*[\'"]([\'"]*)[\'"]'.format(prop), f.read()).group(1)
r = re.search(r'^{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop), f.read(), re.MULTILINE)
o = r.group(1)
return o

with open('README.md', 'r') as fh:
long_description = fh.read()
Expand Down

0 comments on commit f5dc86e

Please sign in to comment.