diff --git a/py-rattler-build/README.md b/py-rattler-build/README.md new file mode 100644 index 00000000..822727f9 --- /dev/null +++ b/py-rattler-build/README.md @@ -0,0 +1 @@ +# Python bindings to rattler-build \ No newline at end of file diff --git a/py-rattler-build/examples/basic.py b/py-rattler-build/examples/basic.py new file mode 100644 index 00000000..fc8771f9 --- /dev/null +++ b/py-rattler-build/examples/basic.py @@ -0,0 +1,4 @@ +import rattler_build + +if __name__ == "__main__": + print(rattler_build.rattler_build_version()) \ No newline at end of file diff --git a/py-rattler-build/pyproject.toml b/py-rattler-build/pyproject.toml new file mode 100644 index 00000000..a33f227e --- /dev/null +++ b/py-rattler-build/pyproject.toml @@ -0,0 +1,54 @@ +[build-system] +requires = ["maturin~=1.2.1"] +build-backend = "maturin" + +[project] +name = "py-rattler-build" +requires-python = ">=3.8" +description = "The fastest way to build conda packages programatically" +readme = "README.md" +authors = [ + { name = "Wolf Vollprecht", email = "w.vollprecht@gmail.com" } +] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + "Programming Language :: Rust", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Typing :: Typed", +] +license = "BSD-3-Clause" + +[project.urls] +Homepage = "https://github.com/prefix-dev/rattler-build" +Repository = "https://github.com/prefix-dev/rattler-build" +Issues = "https://github.com/prefix-dev/rattler-build/labels/python-bindings" + +[tool.maturin] +features = ["pyo3/extension-module"] + +[tool.ruff] +line-length = 120 +target-version = "py38" + +[tool.mypy] +python_version = "3.8" +files = ["rattler_build", "tests", "examples"] +strict = true +enable_error_code = ["redundant-expr", "truthy-bool", "ignore-without-code"] +disable_error_code = ["empty-body"] + +[[tool.mypy.overrides]] +module = ["rattler_build.rattler_build"] +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = ["rattler_build.*"] +# We exclude the rattler module from warn_return_any, because the PyO3 api does not have Python +# type annotations. See https://github.com/PyO3/pyo3/issues/1112 for a discussion on adding +# this capability. We could add a stub file for rattler_build.rattler_build (the PyO3 api), but that +# amounts to duplicating almost all type annotations on our api, as the Python api itself is a +# thin wrapper around the PyO3 api to start with. +warn_return_any = false