|
1
|
|
|
"""A setuptools based setup module. |
|
2
|
|
|
|
|
3
|
|
|
See: |
|
4
|
|
|
https://packaging.python.org/en/latest/distributing.html |
|
5
|
|
|
https://github.com/chdemko/pandoc-latex-tip |
|
6
|
|
|
""" |
|
7
|
|
|
|
|
8
|
|
|
# Always prefer setuptools over distutils |
|
9
|
|
|
from setuptools import setup, find_packages |
|
10
|
|
|
|
|
11
|
|
|
# To use a consistent encoding |
|
12
|
|
|
from codecs import open |
|
13
|
|
|
from os import path, makedirs |
|
14
|
|
|
|
|
15
|
|
|
here = path.abspath(path.dirname(__file__)) |
|
16
|
|
|
|
|
17
|
|
|
# Get the long description from the README file |
|
18
|
|
|
try: |
|
19
|
|
|
import pypandoc |
|
20
|
|
|
long_description = pypandoc.convert('README.md', 'rst') |
|
21
|
|
|
except (IOError, ImportError): |
|
22
|
|
|
with open(path.join(here, 'README.md'), encoding='utf-8') as f: |
|
23
|
|
|
long_description = f.read() |
|
24
|
|
|
|
|
25
|
|
|
from distutils.command.build_py import build_py as _build_py |
|
26
|
|
|
from distutils.command.build_ext import build_ext as _build_ext |
|
27
|
|
|
|
|
28
|
|
|
def _post(): |
|
29
|
|
|
import icon_font_to_png |
|
30
|
|
|
from pkg_resources import get_distribution |
|
31
|
|
|
from appdirs import AppDirs |
|
32
|
|
|
dirs = AppDirs('pandoc_latex_tip', version = get_distribution('pandoc_latex_tip').version) |
|
33
|
|
|
directory = dirs.user_data_dir |
|
34
|
|
|
if not path.exists(directory): |
|
35
|
|
|
makedirs(directory) |
|
36
|
|
|
icon_font_to_png.FontAwesomeDownloader(directory).download_files() |
|
37
|
|
|
|
|
38
|
|
|
class build_py(_build_py): |
|
39
|
|
|
def run(self): |
|
40
|
|
|
_build_py.run(self) |
|
41
|
|
|
self.execute(_post, (), msg="Running post build task") |
|
42
|
|
|
|
|
43
|
|
|
class build_ext(_build_ext): |
|
44
|
|
|
def run(self): |
|
45
|
|
|
_build_ext.run(self) |
|
46
|
|
|
self.execute(_post, (), msg="Running post build task") |
|
47
|
|
|
|
|
48
|
|
|
setup( |
|
49
|
|
|
cmdclass={'build_py': build_py, 'build_ext': build_ext}, |
|
50
|
|
|
name='pandoc-latex-tip', |
|
51
|
|
|
|
|
52
|
|
|
# Versions should comply with PEP440. For a discussion on single-sourcing |
|
53
|
|
|
# the version across setup.py and the project code, see |
|
54
|
|
|
# https://packaging.python.org/en/latest/single_source_version.html |
|
55
|
|
|
version='1.1.0', |
|
56
|
|
|
|
|
57
|
|
|
# The project's description |
|
58
|
|
|
description='A pandoc filter for adding tip in LaTeX', |
|
59
|
|
|
long_description=long_description, |
|
60
|
|
|
|
|
61
|
|
|
# The project's main homepage. |
|
62
|
|
|
url='https://github.com/chdemko/pandoc-latex-tip', |
|
63
|
|
|
|
|
64
|
|
|
# The project's download page |
|
65
|
|
|
download_url = 'https://github.com/chdemko/pandoc-latex-tip/archive/master.zip', |
|
66
|
|
|
|
|
67
|
|
|
# Author details |
|
68
|
|
|
author='Christophe Demko', |
|
69
|
|
|
author_email='[email protected]', |
|
70
|
|
|
|
|
71
|
|
|
# Maintainer details |
|
72
|
|
|
maintainer='Christophe Demko', |
|
73
|
|
|
maintainer_email='[email protected]', |
|
74
|
|
|
|
|
75
|
|
|
# Choose your license |
|
76
|
|
|
license='BSD-3-Clause', |
|
77
|
|
|
|
|
78
|
|
|
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers |
|
79
|
|
|
classifiers=[ |
|
80
|
|
|
# How mature is this project? Common values are |
|
81
|
|
|
# 3 - Alpha |
|
82
|
|
|
# 4 - Beta |
|
83
|
|
|
# 5 - Production/Stable |
|
84
|
|
|
'Development Status :: 5 - Production/Stable', |
|
85
|
|
|
|
|
86
|
|
|
# Specify the OS |
|
87
|
|
|
'Operating System :: OS Independent', |
|
88
|
|
|
|
|
89
|
|
|
# Indicate who your project is intended for |
|
90
|
|
|
'Environment :: Console', |
|
91
|
|
|
'Intended Audience :: End Users/Desktop', |
|
92
|
|
|
'Intended Audience :: Developers', |
|
93
|
|
|
'Topic :: Software Development :: Build Tools', |
|
94
|
|
|
'Topic :: Software Development :: Documentation', |
|
95
|
|
|
'Topic :: Text Processing :: Filters', |
|
96
|
|
|
|
|
97
|
|
|
# Specify the Python versions you support here. In particular, ensure |
|
98
|
|
|
# that you indicate whether you support Python 2, Python 3 or both. |
|
99
|
|
|
'Programming Language :: Python :: 2.7', |
|
100
|
|
|
'Programming Language :: Python :: 3.4', |
|
101
|
|
|
'Programming Language :: Python :: 3.5', |
|
102
|
|
|
], |
|
103
|
|
|
|
|
104
|
|
|
# What does your project relate to? |
|
105
|
|
|
keywords='pandoc filters latex tip Font-Awesome icon', |
|
106
|
|
|
|
|
107
|
|
|
# Alternatively, if you want to distribute just a my_module.py, uncomment |
|
108
|
|
|
# this: |
|
109
|
|
|
py_modules=["pandoc_latex_tip"], |
|
110
|
|
|
|
|
111
|
|
|
# To provide executable scripts, use entry points in preference to the |
|
112
|
|
|
# "scripts" keyword. Entry points provide cross-platform support and allow |
|
113
|
|
|
# pip to create the appropriate form of executable for the target platform. |
|
114
|
|
|
entry_points={ |
|
115
|
|
|
'console_scripts': [ |
|
116
|
|
|
'pandoc-latex-tip = pandoc_latex_tip:main', |
|
117
|
|
|
], |
|
118
|
|
|
}, |
|
119
|
|
|
|
|
120
|
|
|
|
|
121
|
|
|
# List run-time dependencies here. These will be installed by pip when |
|
122
|
|
|
# your project is installed. For an analysis of "install_requires" vs pip's |
|
123
|
|
|
# requirements files see: |
|
124
|
|
|
# https://packaging.python.org/en/latest/requirements.html |
|
125
|
|
|
install_requires=[ |
|
126
|
|
|
'panflute>=1.10', |
|
127
|
|
|
'icon_font_to_png>=0.4', |
|
128
|
|
|
'pillow>=4.3.0', |
|
129
|
|
|
'appdirs>=1.4.0', |
|
130
|
|
|
'pypandoc>=1.4' |
|
131
|
|
|
], |
|
132
|
|
|
|
|
133
|
|
|
# List additional groups of dependencies here (e.g. development |
|
134
|
|
|
# dependencies). You can install these using the following syntax, |
|
135
|
|
|
# for example: |
|
136
|
|
|
# $ pip install -e .[dev,test] |
|
137
|
|
|
extras_require={ |
|
138
|
|
|
'dev': ['check-manifest'], |
|
139
|
|
|
'test': ['coverage'], |
|
140
|
|
|
}, |
|
141
|
|
|
|
|
142
|
|
|
# packages=find_packages(), |
|
143
|
|
|
# include_package_data = True, |
|
144
|
|
|
|
|
145
|
|
|
setup_requires=['pytest-runner'], |
|
146
|
|
|
tests_require=['pytest', 'coverage'], |
|
147
|
|
|
) |
|
148
|
|
|
|