-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
69 lines (62 loc) · 2.06 KB
/
setup.py
File metadata and controls
69 lines (62 loc) · 2.06 KB
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
import glob
import platform
from pybind11.setup_helpers import Pybind11Extension, build_ext
from setuptools import setup
__version__ = "0.0.1"
exclude_files = [
"src/main.cpp",
"src/command_runner.cpp",
"src/config.cpp",
"src/csv_writer.cpp",
"src/image_extractor.cpp",
"src/parameters.cpp",
"src/video_splitter.cpp"
]
system = platform.system()
if system == "Linux":
include_dirs = ["include", "/usr/include/opencv4", "/usr/local/include/fmt"]
library_dirs = ["/usr/local/lib"]
extra_compile_args=[]
extra_link_args=[]
elif system == "Darwin":
# M1 Mac configuration
include_dirs = ["include", "/opt/homebrew/opt/opencv@4/include/opencv4", "/opt/homebrew/include"]
library_dirs = ["/opt/homebrew/lib"]
extra_compile_args=["-mmacosx-version-min=10.15"]
extra_link_args=["-mmacosx-version-min=10.15"]
else:
# windows, yet TBD
include_dirs = []
library_dirs = []
ext_modules = [
Pybind11Extension(
"libshutoh",
sorted([x for x in glob.glob("src/**/*.cpp", recursive=True) if not x in exclude_files]),
include_dirs=include_dirs,
library_dirs=library_dirs,
libraries=["opencv_core", "opencv_videoio", "fmt"],
language="c++",
cxx_std=20,
define_macros=[("SHUTOH_VERSION_INFO", f'"{__version__}"')],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args
),
]
with open("README.md", "r", encoding="utf-8") as f:
long_description = f.read()
setup(
name="libshutoh",
version=__version__,
author="Taichi Nishimura",
author_email="taichitary@gmail.com",
url="https://github.com/awkrail/shutoh",
description="Yet another shot detector implemented in C++, designed as a faster alternative to PySceneDetect",
long_description=long_description,
long_description_content_type="text/markdown",
ext_modules=ext_modules,
extras_require={"test": "pytest"},
cmdclass={"build_ext": build_ext},
zip_safe=False,
python_requires=">=3.8",
install_requires=["scenedetect", "pybind11"]
)