aboutsummaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorAlexis M <alexis@notmyidea.org>2019-09-16 18:54:10 +0200
committerAlexis Metaireau <alexis@notmyidea.org>2019-09-17 11:25:09 +0200
commitbef973d85e3a81979a003a9bac8d17043af7a82d (patch)
tree5a5d2e7e306e4b45f8c6a7a1f795af91cdcf329f /setup.py
parentfabceefececd0978460ba2446ba43821ceee14a7 (diff)
downloadihatemoney-mirror-bef973d85e3a81979a003a9bac8d17043af7a82d.zip
ihatemoney-mirror-bef973d85e3a81979a003a9bac8d17043af7a82d.tar.gz
ihatemoney-mirror-bef973d85e3a81979a003a9bac8d17043af7a82d.tar.bz2
Fix setup.py encoding to be py2 and py3 compatible.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/setup.py b/setup.py
index ad441c0..63596c4 100644
--- a/setup.py
+++ b/setup.py
@@ -1,16 +1,13 @@
# -*- coding: utf-8 -*-
import os
+import sys
+
+from io import open
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
-def read_file(filename):
- """Open a related file and return its content."""
- with open(os.path.join(here, filename), "r") as f:
- return f.read()
-
-
def parse_requirements(filename):
""" load requirements from a pip requirements file """
with open(filename) as lines:
@@ -18,7 +15,12 @@ def parse_requirements(filename):
return [line for line in lineiter if line and not line.startswith("#")]
-README = read_file('README.rst')
+README = open('README.rst', encoding='utf-8').read()
+CHANGELOG = open('CHANGELOG.rst', encoding='utf-8').read()
+
+description = u'\n'.join([README, CHANGELOG])
+if sys.version_info.major < 3:
+ description = description.encode('utf-8')
ENTRY_POINTS = {
'paste.app_factory': [
@@ -33,7 +35,7 @@ ENTRY_POINTS = {
setup(name='ihatemoney',
version='4.1',
description='A simple shared budget manager web application.',
- long_description=README,
+ long_description=description,
license='Custom BSD Beerware',
classifiers=[
"Programming Language :: Python",