mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-17 03:51:03 +03:00
Merge pull request #3928 from linovia/feature/pandoc_for_setup
Use pandoc to generate a nice PyPI information page.
This commit is contained in:
commit
2fc44402f9
|
@ -6,3 +6,6 @@ twine==1.4.0
|
||||||
|
|
||||||
# Transifex client for managing translation resources.
|
# Transifex client for managing translation resources.
|
||||||
transifex-client==0.11
|
transifex-client==0.11
|
||||||
|
|
||||||
|
# Pandoc to have a nice pypi page
|
||||||
|
pypandoc
|
||||||
|
|
16
setup.py
16
setup.py
|
@ -7,6 +7,17 @@ import sys
|
||||||
|
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
|
try:
|
||||||
|
from pypandoc import convert
|
||||||
|
|
||||||
|
def read_md(f):
|
||||||
|
return convert(f, 'rst')
|
||||||
|
except ImportError:
|
||||||
|
print("warning: pypandoc module not found, could not convert Markdown to RST")
|
||||||
|
|
||||||
|
def read_md(f):
|
||||||
|
return open(f, 'r').read()
|
||||||
|
|
||||||
|
|
||||||
def get_version(package):
|
def get_version(package):
|
||||||
"""
|
"""
|
||||||
|
@ -45,6 +56,10 @@ version = get_version('rest_framework')
|
||||||
|
|
||||||
|
|
||||||
if sys.argv[-1] == 'publish':
|
if sys.argv[-1] == 'publish':
|
||||||
|
try:
|
||||||
|
import pypandoc
|
||||||
|
except ImportError:
|
||||||
|
print("pypandoc not installed.\nUse `pip install pypandoc`.\nExiting.")
|
||||||
if os.system("pip freeze | grep wheel"):
|
if os.system("pip freeze | grep wheel"):
|
||||||
print("wheel not installed.\nUse `pip install wheel`.\nExiting.")
|
print("wheel not installed.\nUse `pip install wheel`.\nExiting.")
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
@ -68,6 +83,7 @@ setup(
|
||||||
url='http://www.django-rest-framework.org',
|
url='http://www.django-rest-framework.org',
|
||||||
license='BSD',
|
license='BSD',
|
||||||
description='Web APIs for Django, made easy.',
|
description='Web APIs for Django, made easy.',
|
||||||
|
long_description=read_md('README.md'),
|
||||||
author='Tom Christie',
|
author='Tom Christie',
|
||||||
author_email='tom@tomchristie.com', # SEE NOTE BELOW (*)
|
author_email='tom@tomchristie.com', # SEE NOTE BELOW (*)
|
||||||
packages=get_packages('rest_framework'),
|
packages=get_packages('rest_framework'),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user