Skip to content

Commit

Permalink
Added a setup_package.py for adaptive
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Sep 12, 2023
1 parent 654bfad commit 4903c06
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions reproject/adaptive/setup_package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import os

import numpy as np
from setuptools import Extension


def get_extensions():
libraries = []

sources = []
sources.append(os.path.join(REPROJECT_ROOT, "deforest.pyx"))

include_dirs = [np.get_include()]

define_macros = []

define_macros.append(("CYTHON_LIMITED_API", "0x030800f0"))
define_macros.append(("Py_LIMITED_API", "0x030800f0"))

extension = Extension(
name="reproject.adaptive.deforest",
sources=sources,
include_dirs=include_dirs,
libraries=libraries,
language="c",
extra_compile_args=["-O2"],
define_macros=define_macros,
py_limited_api=True,
)

return [extension]

0 comments on commit 4903c06

Please sign in to comment.