forked from naver/kapture
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
84 lines (72 loc) · 2.64 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
81
82
83
84
# Copyright 2020-present NAVER Corp. Under BSD 3-clause license
import setuptools
import warnings
import os.path as path
from glob import glob
from subprocess import check_call
import os
import tempfile
import sys
HERE = path.normpath(path.dirname(__file__))
# Documentation ########################################################################################################
# setuptools only support md documentation: convert from asciidoc
def read_file(filepath):
with open(filepath, 'r', encoding='utf-8') as f:
return f.read()
def read_doc(filepath):
try: # from asciidoc to markdown
# https://tinyapps.org/blog/201701240700_convert_asciidoc_to_markdown.html
with tempfile.TemporaryDirectory() as tmpdirname:
xml_filepath = path.join(tmpdirname, 'README.xml')
md_filepath = path.join(tmpdirname, 'README.md')
use_shell = sys.platform.startswith("win")
check_call(['asciidoctor', '-b', 'docbook', filepath, '-o', xml_filepath], shell=use_shell)
check_call(['pandoc', '-f', 'docbook', '-t', 'markdown_strict', xml_filepath, '-o', md_filepath],
shell=use_shell)
content = read_file(md_filepath)
except FileNotFoundError:
warnings.warn('cannot convert asciidoc to markdown.')
content = read_file(filepath)
return content
readme_filepath = path.join(HERE, 'README.adoc')
long_description = read_doc(readme_filepath)
########################################################################################################################
setuptools.setup(
# description
name='kapture',
version="1.0.16",
author="naverlabs",
author_email="kapture@naverlabs.com",
description="kapture: file format for SfM",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/naver/kapture/",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
],
# dependencies
python_requires='>=3.6',
install_requires=[
'dataclasses>=0.3'
'numpy>=1.16,<1.20',
'numpy-quaternion>=2019.3.18.14.33.20',
'numba>=0.42',
'matplotlib>=3.0',
'scipy>=1.4',
'tqdm>=4.30',
'Pillow==7.2.0',
'piexif==1.1.3',
'requests>=2.21',
'pyyaml>=5.1',
'wcmatch>=5.0',
'tabulate>=0.8.7',
],
extras_require={
'dev': ['pytest'],
},
# sources
packages=setuptools.find_packages(),
scripts=[f for f in glob(os.path.join(HERE, 'tools', '*.py'))],
)