Skip to content

Commit

Permalink
fix setup to work with new numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
zouter committed Aug 8, 2024
1 parent cffdaa0 commit 8a68eae
Show file tree
Hide file tree
Showing 4 changed files with 7,166 additions and 3,803 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=41", "wheel", "setuptools_scm[toml]>=6.2", "numpy"]
requires = ["setuptools>=41", "wheel", "setuptools_scm[toml]>=6.2", "numpy", "Cython"]
build-backend = "setuptools.build_meta"

[tool.setuptools-git-versioning]
Expand Down
40 changes: 30 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
from setuptools import setup, Extension
from Cython.Build import cythonize
from Cython.Compiler import Options
import numpy

setup_args = dict(
ext_modules=[
Extension(
"chromatinhd.loaders.fragments_helpers",
["src/chromatinhd/loaders/fragments_helpers.c"],
# These are optional
Options.docstrings = True
Options.annotate = False

# Modules to be compiled and include_dirs when necessary
extensions = [
# Extension(
# "pyctmctree.inpyranoid_c",
# ["src/pyctmctree/inpyranoid_c.pyx"],
# ),
Extension(
"chromatinhd.loaders.fragments_helpers",
["src/chromatinhd/loaders/fragments_helpers.pyx"],
include_dirs=[numpy.get_include()],
py_limited_api=True,
),
),
Extension(
"chromatinhd.data.motifscan.scan_helpers",
["src/chromatinhd/data/motifscan/scan_helpers.c"],
["src/chromatinhd/data/motifscan/scan_helpers.pyx"],
include_dirs=[numpy.get_include()],
py_limited_api=True,
),
]
)
setup(**setup_args)
]


# This is the function that is executed
setup(
name='chromatinhd', # Required

# A list of compiler Directives is available at
# https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html#compiler-directives

# external to be compiled
ext_modules = cythonize(extensions, compiler_directives={"language_level": 3, "profile": False}),
)
Loading

0 comments on commit 8a68eae

Please sign in to comment.