Skip to content

Fix/make pep 518 compliant #8

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
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 = ["cython", "numpy", "setuptools", "wheel"]
41 changes: 29 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy
from Cython.Build import cythonize
import subprocess
import sys

setup(
name='choldate',
version='0.1.0',
packages=['choldate','choldate.test'],
cmdclass = {'build_ext': build_ext},
ext_modules = cythonize([Extension("choldate._choldate", ["choldate/_choldate.pyx"],include_dirs = [numpy.get_include()])
]), requires=['numpy','cython']
import setuptools # type: ignore
from setuptools import Extension, setup

try:
from numpy import __version__ as numpy_version
from numpy import get_include
except ImportError:
subprocess.check_call([sys.executable, "-m", "pip", "install", "numpy"])
from numpy import __version__ as numpy_version
from numpy import get_include

try:
from Cython.Build import cythonize
except ImportError:
subprocess.check_call([sys.executable, "-m", "pip", "install", "Cython"])
from Cython.Build import cythonize # type: ignore


ext_modules = cythonize([Extension("choldate._choldate", ["choldate/_choldate.pyx"], include_dirs=[get_include()])])

setup(
name="choldate",
version="0.1.0",
packages=setuptools.find_packages(),
include_package_data=True,
ext_modules=ext_modules,
install_requires=(base_packages := [f"numpy>={numpy_version}"]),
zip_safe=False,
)