forked from manubot/manubot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
80 lines (67 loc) · 2.19 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import pathlib
import re
import subprocess
import setuptools
directory = pathlib.Path(__file__).parent.resolve()
# version
init_path = directory.joinpath('manubot', '__init__.py')
text = init_path.read_text()
pattern = re.compile(r"^__version__ = ['\"]([^'\"]*)['\"]", re.MULTILINE)
version = pattern.search(text).group(1)
# long_description
readme_path = directory.joinpath('README.md')
try:
# Try to create an reStructuredText long_description from README.md
args = 'pandoc', '--from', 'markdown', '--to', 'rst', readme_path
long_description = subprocess.check_output(args)
long_description = long_description.decode()
except Exception as error:
# Fallback to markdown (unformatted on PyPI) long_description
print('README.md conversion to reStructuredText failed. Error:')
print(error)
long_description = readme_path.read_text()
setuptools.setup(
# Package details
name='manubot',
version=version,
url='https://github.com/greenelab/manubot',
description='Manuscript bot for automated scientific publishing',
long_description=long_description,
license='BSD 3-Clause',
# Author details
author='Daniel Himmelstein',
author_email='[email protected]',
# Package topics
keywords='manuscript markdown publishing references citations',
classifiers=[
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Scientific/Engineering :: Information Analysis',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.6',
],
packages=['manubot'],
# Specify python version
python_requires='>=3.6',
# Run-time dependencies
install_requires=[
'errorhandler',
'jinja2',
'pandas',
'pybase62',
'pyyaml',
'requests-cache',
'requests',
],
# Additional groups of dependencies
extras_require={
},
# Create command line script
entry_points={
'console_scripts': [
'manubot = manubot.manubot:main',
],
},
)