From d263a747a5452da562a48526abd0914c74e165dd Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Mon, 22 Sep 2014 15:41:06 +0200 Subject: [PATCH 1/3] Use open() instead of file() --- docs/conf.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index e2002a8d..1bd00f7f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -53,7 +53,7 @@ # The short X.Y version. import re -with file(os.path.join(path_dir, 'intercom', 'intercom.py')) as init: +with open(os.path.join(path_dir, 'intercom', 'intercom.py')) as init: source = init.read() m = re.search("__version__ = '(\d+\.\d+\.\d+)'", source, re.M) version = m.groups()[0] diff --git a/setup.py b/setup.py index 7f2d57e9..b37e338f 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ from setuptools import find_packages from setuptools import setup -with file(os.path.join('intercom', 'intercom.py')) as init: +with open(os.path.join('intercom', 'intercom.py')) as init: source = init.read() m = re.search("__version__ = '(\d+\.\d+\.\d+)'", source, re.M) __version__ = m.groups()[0] From 8b9b83021e67a9fed87865e8e134b98c738d191b Mon Sep 17 00:00:00 2001 From: Matthew Scott Date: Fri, 9 Jan 2015 14:40:31 -0600 Subject: [PATCH 2/3] Extract version from __init__.py, not intercom.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b37e338f..94b5dfce 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ from setuptools import find_packages from setuptools import setup -with open(os.path.join('intercom', 'intercom.py')) as init: +with open(os.path.join('intercom', '__init__.py')) as init: source = init.read() m = re.search("__version__ = '(\d+\.\d+\.\d+)'", source, re.M) __version__ = m.groups()[0] From 36c8fa65862c6ca0881361fc5036326e2b0e9fb4 Mon Sep 17 00:00:00 2001 From: Matthew Scott Date: Fri, 9 Jan 2015 14:41:15 -0600 Subject: [PATCH 3/3] Be more forgiving when extracting version number --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 94b5dfce..295f201f 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ with open(os.path.join('intercom', '__init__.py')) as init: source = init.read() - m = re.search("__version__ = '(\d+\.\d+\.\d+)'", source, re.M) + m = re.search("__version__ = '(.+)'", source, re.M) __version__ = m.groups()[0] setup(