You've already forked httpie-cli
							
							
				mirror of
				https://github.com/httpie/cli.git
				synced 2025-10-30 23:47:52 +02:00 
			
		
		
		
	Pre-process README.rst so that PyPi renders it.
This commit is contained in:
		
							
								
								
									
										12
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								setup.py
									
									
									
									
									
								
							| @@ -1,5 +1,6 @@ | |||||||
| import os | import os | ||||||
| import sys | import sys | ||||||
|  | import re | ||||||
| from setuptools import setup | from setuptools import setup | ||||||
| import httpie | import httpie | ||||||
|  |  | ||||||
| @@ -22,11 +23,20 @@ if 'win32' in str(sys.platform).lower(): | |||||||
|     requirements.append('colorama>=0.2.4') |     requirements.append('colorama>=0.2.4') | ||||||
|  |  | ||||||
|  |  | ||||||
|  | def long_description(): | ||||||
|  |     """Pre-process the README so that PyPi can render it properly.""" | ||||||
|  |     with open('README.rst') as f: | ||||||
|  |         rst = f.read() | ||||||
|  |     code_block = '(:\n\n)?\.\. code-block::.*' | ||||||
|  |     rst = re.sub(code_block, '::', rst) | ||||||
|  |     return rst | ||||||
|  |  | ||||||
|  |  | ||||||
| setup( | setup( | ||||||
|     name='httpie', |     name='httpie', | ||||||
|     version=httpie.__version__, |     version=httpie.__version__, | ||||||
|     description=httpie.__doc__.strip(), |     description=httpie.__doc__.strip(), | ||||||
|     long_description=open('README.rst').read(), |     long_description=long_description(), | ||||||
|     url='http://httpie.org/', |     url='http://httpie.org/', | ||||||
|     download_url='https://github.com/jkbr/httpie', |     download_url='https://github.com/jkbr/httpie', | ||||||
|     author=httpie.__author__, |     author=httpie.__author__, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user