mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-10-31 16:07:38 +03:00 
			
		
		
		
	Render markdown readme on PyPI (#6004)
* Render markdown readme on PyPI PyPI now supports GitHub-flavored Markdown descriptions (https://blog.thea.codes/github-flavored-markdown-on-pypi/), so there's no need to convert the README to rst with pypandoc any more. * Remove readme checking Checking markdown descriptions is not necessary. See https://github.com/pypa/readme_renderer#markdown * Upgrade twine
This commit is contained in:
		
							parent
							
								
									f67d23c441
								
							
						
					
					
						commit
						cf925caa48
					
				|  | @ -32,11 +32,6 @@ matrix: | |||
|           - tox --installpkg ./dist/djangorestframework-*.whl | ||||
|           - tox  # test sdist | ||||
| 
 | ||||
|       - python: "3.6" | ||||
|         env: TOXENV=readme | ||||
|         addons: | ||||
|           apt_packages: pandoc | ||||
| 
 | ||||
|     exclude: | ||||
|       - { python: "2.7", env: DJANGO=master } | ||||
|       - { python: "2.7", env: DJANGO=2.0 } | ||||
|  |  | |||
|  | @ -2,13 +2,7 @@ | |||
| wheel==0.30.0 | ||||
| 
 | ||||
| # Twine for secured PyPI uploads. | ||||
| twine==1.9.1 | ||||
| twine==1.11.0 | ||||
| 
 | ||||
| # Transifex client for managing translation resources. | ||||
| transifex-client==0.11 | ||||
| 
 | ||||
| # Pandoc to have a nice pypi page | ||||
| pypandoc | ||||
| 
 | ||||
| # readme_renderer to check readme syntax | ||||
| readme_renderer | ||||
|  |  | |||
							
								
								
									
										18
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								setup.py
									
									
									
									
									
								
							|  | @ -8,16 +8,9 @@ from io import open | |||
| 
 | ||||
| from setuptools import find_packages, setup | ||||
| 
 | ||||
| try: | ||||
|     from pypandoc import convert_file | ||||
| 
 | ||||
|     def read_md(f): | ||||
|         return convert_file(f, 'rst') | ||||
| except ImportError: | ||||
|     print("warning: pypandoc module not found, could not convert Markdown to RST") | ||||
| 
 | ||||
|     def read_md(f): | ||||
|         return open(f, 'r', encoding='utf-8').read() | ||||
| def read(f): | ||||
|     return open(f, 'r', encoding='utf-8').read() | ||||
| 
 | ||||
| 
 | ||||
| def get_version(package): | ||||
|  | @ -32,10 +25,6 @@ version = get_version('rest_framework') | |||
| 
 | ||||
| 
 | ||||
| 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 twine"): | ||||
|         print("twine not installed.\nUse `pip install twine`.\nExiting.") | ||||
|         sys.exit() | ||||
|  | @ -56,7 +45,8 @@ setup( | |||
|     url='http://www.django-rest-framework.org', | ||||
|     license='BSD', | ||||
|     description='Web APIs for Django, made easy.', | ||||
|     long_description=read_md('README.md'), | ||||
|     long_description=read('README.md'), | ||||
|     long_description_content_type='text/markdown', | ||||
|     author='Tom Christie', | ||||
|     author_email='tom@tomchristie.com',  # SEE NOTE BELOW (*) | ||||
|     packages=find_packages(exclude=['tests*']), | ||||
|  |  | |||
							
								
								
									
										7
									
								
								tox.ini
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								tox.ini
									
									
									
									
									
								
							|  | @ -5,7 +5,7 @@ envlist = | |||
|        {py34,py35,py36}-django20, | ||||
|        {py35,py36}-django21 | ||||
|        {py35,py36}-djangomaster, | ||||
|        dist,lint,docs,readme, | ||||
|        dist,lint,docs, | ||||
| 
 | ||||
| [travis:env] | ||||
| DJANGO = | ||||
|  | @ -50,8 +50,3 @@ commands = mkdocs build | |||
| deps = | ||||
|        -rrequirements/requirements-testing.txt | ||||
|        -rrequirements/requirements-documentation.txt | ||||
| 
 | ||||
| [testenv:readme] | ||||
| commands = ./setup.py check -rs | ||||
| deps = | ||||
|        -rrequirements/requirements-packaging.txt | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user