forked from algoo/preview-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
93 lines (78 loc) · 2.57 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
85
86
87
88
89
90
91
92
93
# -*- coding: utf-8 -*-
# python setup.py sdist upload -r pypi
import os
import sys
from typing import List
from preview_generator import infos
py_version = sys.version_info[:2]
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
try:
documentation = open(os.path.join(here, "README.rst")).read()
except IOError:
documentation = ""
except UnicodeDecodeError:
documentation = ""
testpkgs = [] # type: List[str]
install_requires = [
"python-magic",
"Wand",
"PyPDF2",
"Pillow",
"pyexifinfo",
"packaging",
"xvfbwrapper",
"pathlib",
"pdf2image",
"cairosvg",
"ffmpeg-python",
]
tests_require = ["pytest"]
devtools_require = ["flake8", "isort", "mypy", "pre-commit"]
# add black for python 3.6+
if sys.version_info.major == 3 and sys.version_info.minor >= 6:
devtools_require.append("black")
if py_version <= (3, 4):
install_requires.append("typing")
# TODO - G.M - 2019-11-05 - restore vtk as normal requirement, vtk is not compatible
# with current version of vtk see https://gitlab.kitware.com/vtk/vtk/issues/17670,
if py_version < (3, 8):
install_requires.append("vtk")
setup(
name="preview_generator",
version=infos.__version__,
description=(
"A library for generating preview (thumbnails, text or json overview) "
"for file-based content"
),
long_description=documentation,
author="Algoo",
author_email="contact@algoo.fr",
url="https://github.com/algoo/preview-generator",
download_url=(
"https://github.com/algoo/preview-generator/archive/release_{}.tar.gz".format(
infos.__version__
)
),
keywords=["preview", "preview_generator", "thumbnail", "cache"],
classifiers=[
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
packages=find_packages(exclude=["ez_setup"]),
install_requires=install_requires,
python_requires=">= 3.5",
include_package_data=True,
extras_require={"testing": tests_require, "dev": tests_require + devtools_require},
test_suite="py.test", # TODO : change test_suite
tests_require=testpkgs,
package_data={"preview_generator": ["i18n/*/LC_MESSAGES/*.mo", "templates/*/*", "public/*/*"]},
entry_points={"console_scripts": ["preview = preview_generator.__main__:main"]},
)