summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <rsd@gnu.org>2016-03-05 21:47:46 -0500
committerrsiddharth <rsd@gnu.org>2016-03-05 21:47:46 -0500
commit5299189a7e02df8250d677fa69d3d16e1e09351c (patch)
tree63c6db5ce778359663cb1cc49d46f00398590399
parent863b7855743e6f9eba5d5f80804a2b939ca4c138 (diff)
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.
-rw-r--r--_version.py21
-rw-r--r--lps_gen.py3
-rw-r--r--setup.py15
3 files changed, 35 insertions, 4 deletions
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
+# <http://www.gnu.org/licenses/>.
+
+__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
# <http://www.gnu.org/licenses/>.
-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/',