Commit 896ae2ed authored by Sander Bollen's avatar Sander Bollen

use numpy.get_includes in C-extensions

parent bda5fd58
Pipeline #2442 passed with stage
in 1 minute and 23 seconds
...@@ -3,7 +3,6 @@ build: ...@@ -3,7 +3,6 @@ build:
tags: tags:
- docker - docker
script: script:
- apt-get update && apt-get install -y python-numpy
- pip install --upgrade Cython - pip install --upgrade Cython
- pip install --upgrade numpy - pip install --upgrade numpy
- pip install --upgrade pip setuptools wheel - pip install --upgrade pip setuptools wheel
......
...@@ -6,23 +6,34 @@ setup.py ...@@ -6,23 +6,34 @@ setup.py
:copyright: (c) 2018 Leiden University Medical Center :copyright: (c) 2018 Leiden University Medical Center
:license: MIT :license: MIT
""" """
from os.path import abspath, dirname, join from os.path import abspath, dirname, join
from setuptools import setup, find_packages from setuptools import setup, find_packages
from Cython.Build import cythonize
from vtools import __version__
try:
from Cython.Build import cythonize
except ImportError:
raise NotImplementedError("Installing cython on the fly not yet supported")
try:
import numpy as np
except ImportError:
raise NotImplementedError("Installing numpy on the fly not yet supported")
readme_file = join(abspath(dirname(__file__)), "README.md") readme_file = join(abspath(dirname(__file__)), "README.md")
with open(readme_file) as desc_handle: with open(readme_file) as desc_handle:
long_desc = desc_handle.read() long_desc = desc_handle.read()
# create extensions and add numpy includes to all of them.
cython_extensions = cythonize("vtools/*.pyx")
for ext in cython_extensions:
ext.include_dirs.append(np.get_include())
setup( setup(
name="vtools", name="vtools",
version=__version__, version="0.0.1",
description="Various tools operating over VCF files", description="Various tools operating over VCF files",
author="Sander Bollen", author="Sander Bollen",
author_email="a.h.b.bollen@lumc.nl", author_email="a.h.b.bollen@lumc.nl",
...@@ -46,5 +57,5 @@ setup( ...@@ -46,5 +57,5 @@ setup(
classifiers=[ classifiers=[
"Topic :: Scientific/Engineering :: Bio-Informatics" "Topic :: Scientific/Engineering :: Bio-Informatics"
], ],
ext_modules=cythonize("vtools/*.pyx") ext_modules=cython_extensions
) )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment