mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-10-03 01:48:52 +02:00
src/setup: Add support for ReST readmes by default
This commit is contained in:
parent
cd02444f87
commit
9869136289
18
src/setup.py
18
src/setup.py
@ -65,12 +65,18 @@ if setuptools:
|
|||||||
kwargs.setdefault('url', url)
|
kwargs.setdefault('url', url)
|
||||||
|
|
||||||
if 'long_description' not in kwargs:
|
if 'long_description' not in kwargs:
|
||||||
readme_path = os.path.join(
|
readme_files = [
|
||||||
os.path.dirname(plugin.__file__), 'README.md')
|
('text/x-rst', 'README.rst'),
|
||||||
if os.path.isfile(readme_path):
|
('text/markdown', 'README.md'),
|
||||||
with open(readme_path, 'r') as fd:
|
]
|
||||||
kwargs['long_description'] = fd.read()
|
for (mimetype, filename) in readme_files:
|
||||||
kwargs['long_description_content_type'] = 'text/markdown'
|
readme_path = os.path.join(
|
||||||
|
os.path.dirname(plugin.__file__), filename)
|
||||||
|
if os.path.isfile(readme_path):
|
||||||
|
with open(readme_path, 'r') as fd:
|
||||||
|
kwargs['long_description'] = fd.read()
|
||||||
|
kwargs['long_description_content_type'] = mimetype
|
||||||
|
break
|
||||||
|
|
||||||
module_name = kwargs['name'].replace('-', '_')
|
module_name = kwargs['name'].replace('-', '_')
|
||||||
kwargs.setdefault('packages', [module_name])
|
kwargs.setdefault('packages', [module_name])
|
||||||
|
Loading…
Reference in New Issue
Block a user