This repository was archived by the owner on Sep 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
49 lines (40 loc) · 1.36 KB
/
setup.py
File metadata and controls
49 lines (40 loc) · 1.36 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
import os.path
from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext
class numpy_build_ext(build_ext):
"""
Subclass of build_ext that dynamically imports numpy and adds
numpy.get_include() to the include_dirs.
"""
def finalize_options(self):
build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())
with open(os.path.join(os.path.dirname(__file__), "README.md")) as f:
readme = f.read()
setup(
name="tiffutils",
version="1.0.2",
description="Utilities for TIFF files",
long_description=readme,
long_description_content_type='text/markdown',
author="NC State Aerial Robotics Club",
author_email="aerialrobotics@ncsu.edu",
url="https://github.com/ncsuarc/tiffutils",
license="BSD",
install_requires=["numpy"],
# Use our custom_build_ext that dynamically imports numpy and make sure
# that numpy is installed before we run it
cmdclass={"build_ext": numpy_build_ext},
setup_requires=["numpy"],
ext_modules=[
Extension(
"tiffutils",
extra_compile_args=["-std=gnu99", "-g3"],
libraries=["tiff"],
sources=["tiffutils.c"],
)
],
)