Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setup.py --version to run without Cython, numpy #7

Merged
merged 2 commits into from
Apr 16, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from setuptools import setup, Extension

import numpy as np
from Cython.Build import cythonize
try:
from Cython.Build import cythonize
import numpy as np
fastss_ext = Extension("Ska.Numpy.fastss",
['Ska/Numpy/fastss.pyx'],
include_dirs=[np.get_include()])
except ImportError:
cythonize = lambda arg: None
fastss_ext = None

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't something like this then silently not install the extension if you install within an environment that does not have cython?

fastss_ext = Extension("Ska.Numpy.fastss",
['Ska/Numpy/fastss.pyx'],
include_dirs=[np.get_include()])
try:
from testr.setup_helper import cmdclass
except ImportError:
Expand Down