Skip to content

Commit 7c30118

Browse files
author
Aaron Gonzales
committed
Merge branch 'master' of github.com:twitterdev/search-tweets-python
2 parents 1b9e18d + aafa1b2 commit 7c30118

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

searchtweets/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
from .api_utils import *
66
from .credentials import *
77
from .utils import *
8+
from ._version import VERSION
9+
__version__ = VERSION

searchtweets/_version.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2018 Twitter, Inc.
3+
# Licensed under the MIT License
4+
# https://opensource.org/licenses/MIT
5+
VERSION = "1.6.0"

setup.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,35 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2018 Twitter, Inc.
3+
# Licensed under the MIT License
4+
# https://opensource.org/licenses/MIT
5+
import re
16
from setuptools import setup, find_packages
27

8+
def parse_version(str_):
9+
"""
10+
Parses the program's version from a python variable declaration.
11+
"""
12+
v = re.findall(r"\d+.\d+.\d+", str_)
13+
if v:
14+
return v[0]
15+
else:
16+
print("cannot parse string {}".format(str_))
17+
raise KeyError
18+
19+
# Our version is stored here.
20+
with open("./searchtweets/_version.py") as f:
21+
_version_line = [line for line in f.readlines()
22+
if line.startswith("VERSION")][0].strip()
23+
VERSION = parse_version(_version_line)
24+
325
setup(name='searchtweets',
426
description="Wrapper for Twitter's Premium and Enterprise search APIs",
527
url='https://github.com/twitterdev/search-tweets-python',
628
author='Fiona Pigott, Jeff Kolb, Josh Montague, Aaron Gonzales',
729
long_description=open('README.rst', 'r', encoding="utf-8").read(),
830
author_email='agonzales@twitter.com',
931
license='MIT',
10-
version='1.5.0',
32+
version=VERSION,
1133
python_requires='>=3.3',
1234
install_requires=["requests", "tweet_parser", "pyyaml"],
1335
packages=find_packages(),

0 commit comments

Comments
 (0)