-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from Barsoomx/master
Transition to PEP 518 Build System spec with pyproject.toml
- Loading branch information
Showing
2 changed files
with
42 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel", "Cython", "numpy"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "ckwrap" | ||
version = "1.2.1" | ||
dependencies = [ | ||
"numpy", | ||
"Cython", | ||
] | ||
description = "Python wrapper for Ckmeans.1d.dp, 4.3.5." | ||
authors = [{name = "djdt"}] | ||
license = {file = "LICENSE"} | ||
readme = "README.md" | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/djdt/ckwrap" | ||
|
||
[project.optional-dependencies] | ||
test = [ | ||
"pytest", | ||
"scipy", | ||
] | ||
|
||
[tool.setuptools] | ||
packages = ["ckwrap"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,28 @@ | ||
from Cython.Build import cythonize | ||
from setuptools import setup, Extension | ||
import numpy as np | ||
from Cython.Build import cythonize | ||
|
||
with open("README.md") as fp: | ||
long_description = fp.read() | ||
|
||
sources = [ | ||
"ckwrap/_ckwrap.pyx", | ||
"Ckmeans.1d.dp/src/dynamic_prog.cpp", | ||
"Ckmeans.1d.dp/src/EWL2_dynamic_prog.cpp", | ||
"Ckmeans.1d.dp/src/EWL2_fill_log_linear.cpp", | ||
"Ckmeans.1d.dp/src/EWL2_fill_quadratic.cpp", | ||
"Ckmeans.1d.dp/src/EWL2_fill_SMAWK.cpp", | ||
"Ckmeans.1d.dp/src/fill_log_linear.cpp", | ||
"Ckmeans.1d.dp/src/fill_quadratic.cpp", | ||
"Ckmeans.1d.dp/src/fill_SMAWK.cpp", | ||
"Ckmeans.1d.dp/src/select_levels.cpp", | ||
"Ckmeans.1d.dp/src/weighted_select_levels.cpp", | ||
] | ||
|
||
# Extension definition remains similar to your current setup.py | ||
ckwrap = Extension( | ||
name="_ckwrap", | ||
sources=sources, | ||
sources=[ | ||
"ckwrap/_ckwrap.pyx", | ||
"Ckmeans.1d.dp/src/dynamic_prog.cpp", | ||
"Ckmeans.1d.dp/src/EWL2_dynamic_prog.cpp", | ||
"Ckmeans.1d.dp/src/EWL2_fill_log_linear.cpp", | ||
"Ckmeans.1d.dp/src/EWL2_fill_quadratic.cpp", | ||
"Ckmeans.1d.dp/src/EWL2_fill_SMAWK.cpp", | ||
"Ckmeans.1d.dp/src/fill_log_linear.cpp", | ||
"Ckmeans.1d.dp/src/fill_quadratic.cpp", | ||
"Ckmeans.1d.dp/src/fill_SMAWK.cpp", | ||
"Ckmeans.1d.dp/src/select_levels.cpp", | ||
"Ckmeans.1d.dp/src/weighted_select_levels.cpp", | ||
], | ||
language="c++", | ||
include_dirs=["Ckmeans.1d.dp/src", np.get_include()], | ||
extra_compile_args=["-std=c++11", "-g0"], | ||
) | ||
|
||
|
||
setup( | ||
name="ckwrap", | ||
version="1.2.0", | ||
description="Python wrapper for Ckmeans.1d.dp, 4.3.5.", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
author="djdt", | ||
license="LGPL", | ||
url="https://github.com/djdt/ckwrap", | ||
packages=["ckwrap"], | ||
package_data={"ckwrap": ["*.pxd"]}, | ||
ext_modules=cythonize(ckwrap), | ||
install_requires=["numpy", "Cython"], | ||
tests_require=["pytest", "scipy"], | ||
) |