Specify encoding for README and CHANGELOG in setup.py

This commit is contained in:
Deniz Turgut 2017-01-03 21:51:23 +03:00
commit 6fe2fecb13

View file

@ -1,6 +1,8 @@
#!/usr/bin/env python #!/usr/bin/env python
from io import open
from os import walk from os import walk
from os.path import join, relpath from os.path import join, relpath
import sys
from setuptools import setup from setuptools import setup
@ -17,8 +19,12 @@ entry_points = {
] ]
} }
README = open('README.rst').read() README = open('README.rst', encoding='utf-8').read()
CHANGELOG = open('docs/changelog.rst').read() CHANGELOG = open('docs/changelog.rst', encoding='utf-8').read()
description = u'\n'.join([README, CHANGELOG])
if sys.version_info.major < 3:
description = description.encode('utf-8')
setup( setup(
name='pelican', name='pelican',
@ -29,7 +35,7 @@ setup(
author_email='authors@getpelican.com', author_email='authors@getpelican.com',
description="Static site generator supporting reStructuredText and " description="Static site generator supporting reStructuredText and "
"Markdown source content.", "Markdown source content.",
long_description=README + '\n' + CHANGELOG, long_description=description,
packages=['pelican', 'pelican.tools'], packages=['pelican', 'pelican.tools'],
package_data={ package_data={
# we manually collect the package data, as opposed to using, # we manually collect the package data, as opposed to using,