diff --git a/pyproject.toml b/pyproject.toml index 31ffe04..da72ae4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,34 @@ +[project] +name = "surrealml" +version = "0.0.1" +description = "SurrealMl is a file format for storing machine learning models across python (all versions) and Rust" +readme = "README.md" +dependencies = ["numpy>1.26.3"] +authors = [{ name = "Maxwell Flitton", email = "maxwell@gmail.com" }] + +[project.optional-dependencies] +sklearn = ["skl2onnx==1.16.0", "scikit-learn==1.4.0"] +torch = ["torch==2.1.2"] + +[tool.maturin] +features = ["pyo3/extension-module"] +module-name = "surrealml.rust_surrealml" + [build-system] -requires = ["setuptools", "wheel", "setuptools-rust"] +requires = ["maturin>=1.0,<2.0"] +build-backend = "maturin" + +[tool.setuptools] +packages = [ + "surrealml", + "surrealml.engine", + "surrealml.model_templates", + "surrealml.model_templates.datasets", + "surrealml.model_templates.sklearn", + "surrealml.model_templates.torch", +] +include-package-data = true +zip-safe = true + +[tool.setuptools.package-data] +surrealml = ["binaries/*"] diff --git a/setup.py b/setup.py deleted file mode 100644 index 6123ebc..0000000 --- a/setup.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -from setuptools import setup -from setuptools_rust import Binding, RustExtension - - -with open("README.md", "r") as fh: - long_description = fh.read() - - -setup( - name="surrealml", - author="Maxwell Flitton", - author_email="maxwell@gmail.com", - description="SurrealMl is a file format for storing machine learning models across python (all versions) and rust.", - long_description=long_description, - long_description_content_type="text/markdown", - version="0.0.1", - rust_extensions=[RustExtension("surrealml.rust_surrealml", binding=Binding.PyO3)], - packages=[ - "surrealml", - "surrealml.engine", - "surrealml.model_templates", - "surrealml.model_templates.datasets", - "surrealml.model_templates.sklearn", - "surrealml.model_templates.torch", - ], - package_data={ - "surrealml": ["binaries/*"], - }, - # rust extensions are not zip safe, just like C-extensions. - zip_safe=False, - include_package_data=True, - requirements=[ - "numpy==1.26.3", - ], - extras_require={ - "sklearn": [ - "skl2onnx==1.16.0", - "scikit-learn==1.4.0" - ], - "torch": [ - "torch==2.1.2" - ] - } -)