From 5299189a7e02df8250d677fa69d3d16e1e09351c Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sat, 5 Mar 2016 21:47:46 -0500 Subject: fixed setup.py - version info is loaded from _version.py - to read the README.rst (for long_description), we now use a function defined in setup.py instead of using `lps_gen.read_file` function. --- _version.py | 21 +++++++++++++++++++++ lps_gen.py | 3 ++- setup.py | 15 ++++++++++++--- 3 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 _version.py diff --git a/_version.py b/_version.py new file mode 100644 index 0000000..1869878 --- /dev/null +++ b/_version.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2015 lpschedule-generator contributors. See CONTRIBUTORS. +# +# This file is part of lpschedule-generator. +# +# lpschedule-generator is free software: you can redistribute it +# and/or modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 of +# the License, or (at your option) any later version. +# +# lpschedule-generator is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with lpschedule-generator (see COPYING). If not, see +# . + +__version__ = '0.3.2.dev' diff --git a/lps_gen.py b/lps_gen.py index ccb7f11..56fd15e 100644 --- a/lps_gen.py +++ b/lps_gen.py @@ -31,7 +31,8 @@ from jinja2.exceptions import TemplateNotFound from mistune import Renderer, Markdown from unidecode import unidecode -__version__ = '0.3.1' +from _version import __version__ + # unicode magic reload(sys) diff --git a/setup.py b/setup.py index d10e61d..e44de21 100644 --- a/setup.py +++ b/setup.py @@ -19,16 +19,25 @@ # along with lpschedule-generator (see COPYING). If not, see # . -import lps_gen +import _version from setuptools import setup, find_packages +def readf(filename): + content = '' + try: + with open(filename, 'rb') as f: + for line in f: + content = content + line + except IOError: + print "Error: unable to open %s" % filename + return content config = { 'name': 'lpschedule-generator', 'description': 'LibrePlanet schedule generator', - 'long_description': lps_gen.read_file('README.rst'), - 'version': lps_gen.__version__, + 'long_description': readf('README.rst'), + 'version': _version.__version__, 'platforms': 'GNU/Linux', 'license': 'GNU General Public License version 3 or later', 'url': 'https://notabug.org/rsd/lpschedule-generator/', -- cgit v1.2.3