Populate the project long_description by reading the README.rst file using "utf-8" encoding and excluding potential Sphinx directives.
This commit is contained in:
parent
c1a6513314
commit
0324d6bf18
1 changed files with 17 additions and 4 deletions
|
|
@ -1,6 +1,19 @@
|
||||||
import setuptools
|
import io
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
|
||||||
setuptools.setup(
|
from setuptools import find_packages
|
||||||
|
from setuptools import setup
|
||||||
|
|
||||||
|
|
||||||
|
def read(filename):
|
||||||
|
filename = os.path.join(os.path.dirname(__file__), filename)
|
||||||
|
text_type = type(u"")
|
||||||
|
with io.open(filename, mode="r", encoding='utf-8') as fd:
|
||||||
|
return re.sub(text_type(r':[a-z]+:`~?(.*?)`'), text_type(r'``\1``'), fd.read())
|
||||||
|
|
||||||
|
|
||||||
|
setup(
|
||||||
name="{{ cookiecutter.package_name }}",
|
name="{{ cookiecutter.package_name }}",
|
||||||
version="{{ cookiecutter.package_version }}",
|
version="{{ cookiecutter.package_version }}",
|
||||||
url="{{ cookiecutter.package_url }}",
|
url="{{ cookiecutter.package_url }}",
|
||||||
|
|
@ -9,9 +22,9 @@ setuptools.setup(
|
||||||
author_email="{{ cookiecutter.author_email }}",
|
author_email="{{ cookiecutter.author_email }}",
|
||||||
|
|
||||||
description="{{ cookiecutter.package_description }}",
|
description="{{ cookiecutter.package_description }}",
|
||||||
long_description=open('README.rst').read(),
|
long_description=read("README.rst"),
|
||||||
|
|
||||||
packages=setuptools.find_packages(exclude=('tests',)),
|
packages=find_packages(exclude=('tests',)),
|
||||||
|
|
||||||
install_requires=[],
|
install_requires=[],
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue