mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-25 12:19:24 +01: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)
|
||||
|
||||
if 'long_description' not in kwargs:
|
||||
readme_path = os.path.join(
|
||||
os.path.dirname(plugin.__file__), 'README.md')
|
||||
if os.path.isfile(readme_path):
|
||||
with open(readme_path, 'r') as fd:
|
||||
kwargs['long_description'] = fd.read()
|
||||
kwargs['long_description_content_type'] = 'text/markdown'
|
||||
readme_files = [
|
||||
('text/x-rst', 'README.rst'),
|
||||
('text/markdown', 'README.md'),
|
||||
]
|
||||
for (mimetype, filename) in readme_files:
|
||||
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('-', '_')
|
||||
kwargs.setdefault('packages', [module_name])
|
||||
|
Loading…
Reference in New Issue
Block a user