-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix .travis.yml #795
fix .travis.yml #795
Conversation
Codecov Report
@@ Coverage Diff @@
## master #795 +/- ##
=======================================
Coverage 98.37% 98.37%
=======================================
Files 231 231
Lines 2520 2520
=======================================
Hits 2479 2479
Misses 41 41 Continue to review full report at Codecov.
|
setup.py
Outdated
@@ -1,7 +1,7 @@ | |||
import re | |||
from setuptools import setup, find_packages | |||
|
|||
__version__ = re.match(r"__version__.*\s*=\s*[']([^']+)[']", open('dateparser/__init__.py').read())[1] | |||
__version__ = re.findall(r"__version__.*\s*=\s*[']([^']+)[']", open('dateparser/__init__.py').read())[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untested, but this might also work and be closer to the original code:
__version__ = re.findall(r"__version__.*\s*=\s*[']([^']+)[']", open('dateparser/__init__.py').read())[0] | |
__version__ = re.search(r"__version__.*\s*=\s*[']([^']+)[']", open('dateparser/__init__.py').read())[1] |
re.match
is basically re.search
with an implicit ^
in the pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. The problem is indeed the syntax. Today I learn that is specific to 3.6+.
What about using the old syntax equivalent, .group(1)
?
No description provided.