Skip to content

Commit

Permalink
Merge pull request #380 from lheinke/master
Browse files Browse the repository at this point in the history
Fix for Cython installation issue
  • Loading branch information
bjfultn authored Sep 11, 2023
2 parents 9b48389 + 876108e commit 8b1665e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools", "wheel", "Cython", "pybind11", "numpy"]
18 changes: 6 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext as _build_ext
import re


class build_ext(_build_ext):
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())

import numpy

def get_property(prop, project):
result = re.search(r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop),
open(project + '/__init__.py').read())
return result.group(1)


extensions = [Extension("radvel._kepler", ["src/_kepler.pyx"],)]
extensions = [
Extension(
"radvel._kepler", ["src/_kepler.pyx"],
include_dirs=[numpy.get_include()])
]

reqs = []
for line in open('requirements.txt', 'r').readlines():
Expand All @@ -32,7 +27,6 @@ def get_property(prop, project):
packages=find_packages(),
setup_requires=['numpy', 'cython'],
ext_modules=extensions,
cmdclass={'build_ext': build_ext},
data_files=[
(
'radvel_example_data',
Expand Down

0 comments on commit 8b1665e

Please sign in to comment.