From a41574e31a933c677cb99c7f6871cd545e12510a Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Fri, 6 Nov 2015 22:08:14 +0100 Subject: [PATCH] Make version fetching a bit more robust (use pbr). --- .gitignore | 2 +- dosagelib/__init__.py | 7 ++++--- requirements.txt | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 324c33c03..4424904be 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ *.orig *.pyc *.pyo -/*.egg +/.eggs /Comics /build /dist diff --git a/dosagelib/__init__.py b/dosagelib/__init__.py index b082fc6a2..24dd38b31 100644 --- a/dosagelib/__init__.py +++ b/dosagelib/__init__.py @@ -1,6 +1,7 @@ # -*- coding: iso-8859-1 -*- # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam +# Copyright (C) 2015 Tobias Gruetzmacher """ Automated comic downloader. Dosage traverses comic websites in order to download each strip of the comic. The intended use is for @@ -13,8 +14,8 @@ The primary interface is the 'dosage' commandline script. Comic modules for each comic are located in L{dosagelib.plugins}. """ -from pkg_resources import get_distribution +from pbr.version import VersionInfo AppName = u'dosage' -dist = get_distribution(AppName) -__version__ = dist.version # PEP 396 +version_info = VersionInfo(AppName) +__version__ = version_info.version_string() # PEP 396 diff --git a/requirements.txt b/requirements.txt index 856cb4577..922f47b4c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ requests>=2.0 +pbr