Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
54 lines (48 loc) · 1.58 KB
/
Copy pathsetup.py
File metadata and controls
54 lines (48 loc) · 1.58 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
import sysconfig
from setuptools import Extension, setup
dev_mode = False
tinydng_compile_args = []
free_threaded = str(sysconfig.get_config_var("Py_GIL_DISABLED")) == "1"
python_defines = [("Py_GIL_DISABLED", "1")] if free_threaded else []
if dev_mode:
tinydng_compile_args.append('-O0')
tinydng_compile_args.append('-g')
tinydng_compile_args.append('-fsanitize=address')
ext_modules = [
Extension("tinydng_ext",
sorted([
"python/python-bindings.c",
"tinydng_api.c",
"tinydng_io.c",
"tinydng_tiff.c",
"tinydng_dng.c",
"tinydng_codec.c",
"tinydng_write.c",
"tinydng_psd.c",
"tinydng_psd_write.c",
"tinydng_miniz.c",
"tinydng_stb_image.c",
"tiny_dng_ljpeg92_v2.c",
]),
include_dirs=['.'],
define_macros=python_defines,
py_limited_api=not free_threaded,
extra_compile_args=tinydng_compile_args
),
]
setup(
name="tinydng",
package_dir={'': 'python'},
packages=['tinydng'],
url="https://github.com/syoyo/tinydng",
description="Tiny DNG loader/saver",
long_description=open("./README.md", 'r', encoding='utf8').read(),
long_description_content_type='text/markdown',
ext_modules=ext_modules,
#extras_require={"test": "pytest"},
## Currently, build_ext only provides an optional "highest supported C++
## level" feature, but in the future it may provide more features.
## cmdclass={"build_ext": build_ext},
#zip_safe=False,
#python_requires=">=3.6",
)