From 48034373624a260d608d18ad1dd67793cc6e5d21 Mon Sep 17 00:00:00 2001 From: Mattias Roback Date: Thu, 18 Apr 2019 15:59:21 +0200 Subject: [PATCH 1/2] Only define version number in one place close #20 --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2400460..94e7352 100644 --- a/setup.py +++ b/setup.py @@ -5,6 +5,7 @@ import os from setuptools import setup, find_packages +from twingly_search.__init__ import __version__ if 'GENERATE_RST' in os.environ: import pypandoc @@ -19,7 +20,7 @@ setup( name='twingly-search', - version='2.1.3', + version=__version__, author='Twingly AB', author_email='support@twingly.com', license='MIT', From cec0fca8cfebf7f32f3a913d1a3af0f1717711cf Mon Sep 17 00:00:00 2001 From: Mattias Roback Date: Thu, 18 Apr 2019 16:15:44 +0200 Subject: [PATCH 2/2] Move version to separate file We don't want to import the whole twingly_search.__init__ file (which in turn imports all other classes) into the setup.py file. --- setup.py | 4 ++-- twingly_search/__init__.py | 4 +++- twingly_search/version.py | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 twingly_search/version.py diff --git a/setup.py b/setup.py index 94e7352..4ac0c1e 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ import os from setuptools import setup, find_packages -from twingly_search.__init__ import __version__ +from twingly_search.version import version if 'GENERATE_RST' in os.environ: import pypandoc @@ -20,7 +20,7 @@ setup( name='twingly-search', - version=__version__, + version=version, author='Twingly AB', author_email='support@twingly.com', license='MIT', diff --git a/twingly_search/__init__.py b/twingly_search/__init__.py index e87f5d6..171fc1d 100644 --- a/twingly_search/__init__.py +++ b/twingly_search/__init__.py @@ -3,8 +3,10 @@ """A library provides Python interface to the Twingly Search API""" from __future__ import absolute_import +from .version import version + __author__ = 'Twingly AB' -__version__ = '2.1.3' +__version__ = version from .client import Client from .errors import TwinglySearchException diff --git a/twingly_search/version.py b/twingly_search/version.py new file mode 100644 index 0000000..0c05f1e --- /dev/null +++ b/twingly_search/version.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python + +version = '2.1.3'