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

Version bump from 0.0.1 to 1.0.2. #19

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions gearsclient/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from ._version import __version__
from .redisgears_builder import GearsRemoteBuilder, log, gearsConfigGet, execute, atomic, hashtag
3 changes: 3 additions & 0 deletions gearsclient/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This attribute is the only one place that the version number is written down,
# so there is only one place to change it when the version number changes.
__version__ = "1.0.2"
19 changes: 18 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
from setuptools import setup, find_packages
import io

def read_version(version_file):
"""
Given the input version_file, this function extracts the
version info from the __version__ attribute.
"""
version_str = None
import re
verstrline = open(version_file, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
if mo:
version_str = mo.group(1)
else:
raise RuntimeError("Unable to find version string in %s." % (version_file,))
return version_str


def read_all(f):
with io.open(f, encoding="utf-8") as I:
return I.read()
Expand All @@ -9,7 +26,7 @@ def read_all(f):

setup(
name='gearsclient',
version='0.1',
version=read_version("gearsclient/_version.py"),
description='RedisGears Python Client',
long_description=read_all("README.md"),
long_description_content_type='text/markdown',
Expand Down
4 changes: 4 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

counter = 0

def testVersionRuntime(self):
import gearsclient as gears_pkg
self.assertNotEqual("",gears_pkg.__version__)

def getGB(env, reader='KeysReader'):
return GRB(reader, r=env.getConnection(), addClientToRequirements=False)

Expand Down