From 2dc5bf743d25ab62a72a1f1e67d18330cbc73952 Mon Sep 17 00:00:00 2001
From: Piotr Maslanka <piotr.maslanka@henrietta.com.pl>
Date: Fri, 16 Feb 2018 22:33:14 +0100
Subject: [PATCH] one source of version truth

---
 docs/conf.py        | 5 +++--
 satella/__init__.py | 3 ++-
 setup.cfg           | 1 -
 setup.py            | 2 ++
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/docs/conf.py b/docs/conf.py
index cf78f504..ff1d1df7 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -59,9 +59,10 @@ author = u'Piotr Maślanka'
 # built documents.
 #
 # The short X.Y version.
-version = u'2.0'
+from satella import __version__
+version = __version__.split('.', 2)[:2].join('.')
 # The full version, including alpha/beta/rc tags.
-release = u'2.0.22rc2'
+release = __version__
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/satella/__init__.py b/satella/__init__.py
index 8b137891..364e327f 100644
--- a/satella/__init__.py
+++ b/satella/__init__.py
@@ -1 +1,2 @@
-
+# coding=UTF-8
+__version__ = '2.0.22rc2'
diff --git a/setup.cfg b/setup.cfg
index 566441c4..8ed4ee18 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,5 @@
 [metadata]
 name = satella
-version = 2.0.22rc2
 description-file = README.md
 author = Piotr Maślanka
 author_email = piotrm@smok.co
diff --git a/setup.py b/setup.py
index ce8a6213..00b5b535 100644
--- a/setup.py
+++ b/setup.py
@@ -1,8 +1,10 @@
 # coding=UTF-8
 from setuptools import setup, find_packages
+from satella import __version__
 
 setup(keywords=['ha', 'high availability', 'scalable', 'scalability', 'server'],
       packages=find_packages(include=['satella', 'satella.*']),
+      version=__version__,
       install_requires=[
           "six",
           "monotonic",
-- 
GitLab