-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
60 lines (49 loc) · 1.68 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
from setuptools import setup
from pathlib import Path
from typing import List
SHORT_DESCRIPTION = 'Create Foliant projects from templates.'
try:
with open('README.md', encoding='utf8') as readme:
LONG_DESCRIPTION = readme.read()
except FileNotFoundError:
LONG_DESCRIPTION = SHORT_DESCRIPTION
def get_templates(path: Path) -> List[str]:
"""List all files in ``templates`` directory, including all subdirectories.
The resulting list contains UNIX-like relative paths starting with ``templates``.
"""
result = []
for item in path.glob('**/*'):
if item.is_file() and not item.name.startswith('_'):
result.append(item.relative_to(path.parent).as_posix())
return result
setup(
name='foliantcontrib.init',
description=SHORT_DESCRIPTION,
long_description=LONG_DESCRIPTION,
long_description_content_type='text/markdown',
version='1.0.10',
author='Konstantin Molchanov',
author_email='moigagoo@live.com',
url='https://github.com/foliant-docs/foliantcontrib.init',
packages=['foliant.cli.init'],
package_data={'foliant.cli.init': get_templates(Path('foliant/cli/init/templates'))},
license='MIT',
platforms='any',
install_requires=[
'foliant>=1.0.8',
'python-slugify',
'validators',
'gitpython',
'cliar'
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Documentation',
'Topic :: Utilities',
]
)