Skip to content
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

Merged
merged 5 commits into from
Sep 25, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ deploy:
on:
tags: true
repo: scrapinghub/dateparser
condition: "$PYPI_RELEASE_JOB == true
condition: "$PYPI_RELEASE_JOB == true"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -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]
Copy link
Member

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:

Suggested change
__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.

Copy link
Member

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)?


introduction = re.sub(r':members:.+|..\sautomodule::.+|:class:|:func:|:ref:', '', open('docs/introduction.rst').read())
history = re.sub(r':mod:|:class:|:func:', '', open('HISTORY.rst').read())
Expand Down