-
Notifications
You must be signed in to change notification settings - Fork 23
/
setup.py
37 lines (32 loc) · 1.2 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
"""Setup script for the DEODR project."""
import os
import re
from Cython.Build import cythonize
import numpy as np
from setuptools import Extension, find_packages, setup
extension = Extension(
name="deodr.differentiable_renderer_cython",
sources=["deodr/differentiable_renderer_cython.pyx"],
include_dirs=["deodr", np.get_include()],
)
with open(os.path.join(os.path.dirname(__file__), "deodr", "__init__.py")) as fp:
for line in fp:
m = re.search(r'^\s*__version__\s*=\s*([\'"])([^\'"]+)\1\s*$', line)
if m:
version = m.group(2)
break
else:
raise RuntimeError("Unable to find own __version__ string")
print(f"version = {version}")
readme_file = os.path.join(os.path.dirname(__file__), "readme.md")
setup(
version=version,
url="https://github.com/martinResearch/DEODR",
data_files=[("C++", ["C++/DifferentiableRenderer.h"])],
ext_modules=cythonize([extension], annotate=True, build_dir="build"),
include_dirs=[np.get_include()],
packages=find_packages(),
package_data={"deodr": ["*.pyx", "*.pxd", "data/*.*", "data/**/*.*"]},
long_description=open(readme_file, "r").read(),
long_description_content_type="text/markdown",
)