-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make mypy run properly, add pyproject.toml
- Loading branch information
Showing
3 changed files
with
59 additions
and
0 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 @@ | ||
# Python bindings to rattler-build |
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,4 @@ | ||
import rattler_build | ||
|
||
if __name__ == "__main__": | ||
print(rattler_build.rattler_build_version()) |
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,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 = "[email protected]" } | ||
] | ||
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 |