add poetry setup

This commit is contained in:
Martin Bubel 2024-07-15 16:20:29 +02:00
parent bfa1d67fda
commit 875e3f4253
3 changed files with 3324 additions and 0 deletions

62
build.py Normal file
View file

@ -0,0 +1,62 @@
import sys
import numpy as np
from setuptools import setup, Extension
def ismac():
return sys.platform[:6] == "darwin"
if ismac():
compile_flags = ["-O3"]
link_args = []
else:
compile_flags = ["-fopenmp", "-O3"]
link_args = ["-lgomp"]
extensions = [
Extension(
name="GPy.kern.src.stationary_cython",
sources=[
"GPy/kern/src/stationary_cython.pyx",
"GPy/kern/src/stationary_utils.c",
],
include_dirs=[np.get_include(), "."],
extra_compile_args=compile_flags,
extra_link_args=link_args,
),
Extension(
name="GPy.util.choleskies_cython",
sources=["GPy/util/choleskies_cython.pyx"],
include_dirs=[np.get_include(), "."],
extra_link_args=link_args,
extra_compile_args=compile_flags,
),
Extension(
name="GPy.util.linalg_cython",
sources=["GPy/util/linalg_cython.pyx"],
include_dirs=[np.get_include(), "."],
extra_compile_args=compile_flags,
extra_link_args=link_args,
),
Extension(
name="GPy.kern.src.coregionalize_cython",
sources=["GPy/kern/src/coregionalize_cython.pyx"],
include_dirs=[np.get_include(), "."],
extra_compile_args=compile_flags,
extra_link_args=link_args,
),
Extension(
name="GPy.models.state_space_cython",
sources=["GPy/models/state_space_cython.pyx"],
include_dirs=[np.get_include(), "."],
extra_compile_args=compile_flags,
extra_link_args=link_args,
),
]
def build(setup_kwargs):
"""Needed for the poetry building interface."""
setup_kwargs.update({
'ext_modules': extensions,
# 'include_dirs': [np.get_include()],
})

3217
poetry.lock generated Normal file

File diff suppressed because it is too large Load diff

45
pyproject.toml Normal file
View file

@ -0,0 +1,45 @@
[tool.poetry]
name = "GPy"
version = "1.13.1"
description = "The Gaussian Process Toolbox"
authors = ["GPy Authors <https://github.com/SheffieldML/GPy/graphs/contributors"]
license = "BSD-3-Clause"
keywords = ["machine-learning", "gaussian-processes", "kernels"]
homepage = "https://sheffieldml.github.io/GPy/"
repository = "https://github.com/SheffieldML/GPy"
documentation = "https://github.com/SheffieldML/GPy"
readme = "README.md"
build = "build.py"
include = ["build.py"]
[tool.poetry.dependencies]
python = ">=3.9"
numpy = "^1.7"
six = "*"
paramz = ">=0.9.6"
cython = "^0.29"
scipy = ">=1.3.0,<=1.12.0" # TODO: why this upper bound?
sphinx = { version = "*", optional = true }
mpi4py = { version = "*", optional = true }
ipython = { version = ">=4.0.0", optional = true }
matplotlib = { version = ">=3.3.4", optional = true }
plotly = { version = ">=1.8.6", optional = true }
jupyter_client = { version = ">=4.0.6", optional = true }
ipywidgets = { version = ">=4.0.3", optional = true }
ipykernel = { version = ">=4.1.0", optional = true }
notebook = { version = ">=4.0.5", optional = true }
[tool.poetry.extras]
docs = ["sphinx"]
optional = ["mpi4py", "ipython"]
plotting = ["matplotlib", "plotly"]
notebook = ["jupyter_client", "ipywidgets", "ipykernel", "notebook"]
[tool.poetry.group.dev.dependencies]
matplotlib = "^3.9.1"
pytest = "^8.2.2"
pods = "^0.1.14"
[build-system]
requires = ["poetry-core>=1.0.0", "setuptools", "wheel", "numpy", "cython"]
build-backend = "poetry.core.masonry.api"