forked from popomore/ufbx-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
98 lines (88 loc) · 2.91 KB
/
Copy pathsetup.py
File metadata and controls
98 lines (88 loc) · 2.91 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
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
"""
ufbx-python setup script - Cython implementation
"""
import os
import sys
import numpy as np
from Cython.Build import cythonize
from setuptools import Extension, find_packages, setup
# Read version
def get_version():
version_file = os.path.join(os.path.dirname(__file__), "ufbx", "__init__.py")
with open(version_file) as f:
for line in f:
if line.startswith("__version__"):
return line.split("=")[1].strip().strip("'\"")
return "0.1.0"
# Read long description
def get_long_description():
readme_file = os.path.join(os.path.dirname(__file__), "README.md")
if os.path.exists(readme_file):
with open(readme_file, encoding="utf-8") as f:
return f.read()
return ""
# Define Cython extension
if sys.platform == "win32":
_optimize_args = ["/O2"]
else:
_optimize_args = ["-O3"]
extensions = [
Extension(
"ufbx._ufbx",
sources=[
"ufbx/_ufbx.pyx",
"ufbx/src/ufbx_wrapper.c",
"ufbx-c/ufbx.c",
],
include_dirs=[
"ufbx",
"ufbx/src",
".",
np.get_include(),
],
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
extra_compile_args=_optimize_args,
)
]
setup(
name="pyufbx",
version=get_version(),
description="Python bindings for ufbx - Single source file FBX loader",
long_description=get_long_description(),
long_description_content_type="text/markdown",
author="ufbx-python contributors",
url="https://github.com/popomore/ufbx-python",
project_urls={
"Bug Reports": "https://github.com/popomore/ufbx-python/issues",
"Source": "https://github.com/popomore/ufbx-python",
"Documentation": "https://github.com/popomore/ufbx-python#readme",
},
packages=find_packages(exclude=["tests", "tests.*", "examples", "bindgen"]),
ext_modules=cythonize(
extensions,
compiler_directives={
"language_level": 3,
"embedsignature": True,
},
),
install_requires=["numpy"],
python_requires=">=3.9",
keywords="fbx 3d graphics modeling autodesk loader cython",
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: C",
"Programming Language :: Cython",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Multimedia :: Graphics :: 3D Modeling",
"Topic :: Software Development :: Libraries :: Python Modules",
],
zip_safe=False,
)