-
Notifications
You must be signed in to change notification settings - Fork 60
/
setup.py
executable file
·114 lines (100 loc) · 3.26 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import os
import sys
import setuptools
from distutils.core import Command
with open("README.md", "r", encoding='utf-8') as fh:
long_description = fh.read()
if sys.version_info >= (3,10):
sys.exit("Python version greater than 3.9 not supported because of potential compatibility issues")
# This will store the models
network_folder_path = os.path.join(os.path.expanduser("~"), ".katna")
if not os.path.exists(network_folder_path):
os.mkdir(network_folder_path)
# helper functions to make it easier to list dependencies not as a python list, but vertically w/ optional built-in comments to why a certain version of the dependency is listed
def cleanup(x):
return re.sub(r" *#.*", "", x.strip()) # comments
def to_list(buffer):
return list(filter(None, map(cleanup, buffer.splitlines())))
# normal dependencies ###
#
# these get resolved and installed via either of these two:
#
# pip install katna
# pip install -e .
#
# IMPORTANT: when updating these, please make sure to sync conda/meta.yaml
#
# Important dependencies and their use:
# opencv-contrib-python: opencv library with contrib extension for image
# processing tasks
# image_ffmpeg: This module automatically installs ffmpeg binaries for use
# in frames extraction from video
# ffmpy: Thin wrapper on top of ffmpeg binary for calling ffmpeg executables
# using python, used in video duration calculation and frame extraction
# from video
# requests: python requests library is used for downloading text detection model
# if needed.
# scipy, scikit-learn, numpy, imutils are used for general io for images and
# and utilities
dep_groups = {
"core": to_list(
"""
scipy
scikit-learn
scikit-image
opencv-contrib-python>=3.4.7
numpy>=1.15
imageio_ffmpeg>=0.2.0
imutils
requests
psutil
ffmpy
"""
)
}
# Get version info from Katna/version.py location
__version__ = None # Explicitly set version.
exec(open('Katna/version.py').read()) # loads __version__
requirements = [y for x in dep_groups.values() for y in x]
setup_requirements = to_list(
"""
pytest-runner
setuptools>=36.2
"""
)
# test dependencies ###
test_requirements = to_list(
"""
pytest
"""
)
setuptools.setup(
name="katna",
version=__version__,
author="keplerlab",
author_email="[email protected]",
description="Katna is a tool that automates video key/best frames extraction.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/keplerlab/Katna.git",
packages=setuptools.find_packages(),
install_requires=requirements,
setup_requires=setup_requirements,
tests_require=test_requirements,
python_requires=">=3.6",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
project_urls={
"Documentation": "https://katna.readthedocs.io",
"Source": "https://github.com/keplerlab/Katna",
"Tracker": "https://github.com/keplerlab/Katna/issues",
},
include_package_data=True,
zip_safe=False,
)