forked from rerun-io/rerun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
167 lines (137 loc) · 5.89 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
[build-system]
build-backend = "maturin"
requires = ["maturin>=1.5.1"]
[project]
classifiers = [
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Development Status :: 3 - Alpha",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Visualization",
]
dependencies = [
# Must match list in `.github/workflows/reusable_test_wheels.yml`
"attrs>=23.1.0",
"numpy>=1.23,<2",
"pillow>=8.0.0", # Used for JPEG encoding. 8.0.0 added the `format` arguments to `Image.open`
"pyarrow>=14.0.2",
"typing_extensions>=4.5", # Used for PEP-702 deprecated decorator
]
description = "The Rerun Logging SDK"
keywords = ["computer-vision", "logging", "rerun"]
name = "rerun-sdk"
requires-python = ">=3.8, <3.13"
[[project.authors]]
email = "[email protected]"
name = "Rerun.io"
[project.license]
text = "MIT OR Apache-2.0"
[project.optional-dependencies]
tests = ["pytest==7.1.2"]
[project.urls]
documentation = "https://www.rerun.io/docs"
homepage = "https://www.rerun.io"
repository = "https://github.com/rerun-io/rerun"
[project.scripts]
rerun = "rerun_cli.__main__:main"
[tool.ruff]
# https://beta.ruff.rs/docs/configuration/
# target-version = "py38" # inferred from requires-python, see https://beta.ruff.rs/docs/settings/#target-version
# Enable unsafe fixes to allow ruff to apply fixes that may change the behavior of the code.
# This is needed because otherwise ruff will not be able to trim whitespaces in (codegened) docstrings.
unsafe-fixes = true
# Allow preview lints to be enabled (like `PLW1514` to force `encoding` on open).
preview = true
# But we only want to opt-in to certain preview rules!
lint.explicit-preview-rules = true
extend-exclude = [
# Automatically generated test artifacts
"venv/",
"target/",
# Intentionally uses ''' instead of """ so we can embed it in a docstring in the Python API docs.
"docs/snippets/all/archetypes/text_document.py",
"docs/snippets/all/views/text_document.py",
# TODO(#4047): incomplete example snippet
"docs/snippets/all/tutorials/timelines_example.py",
# generated
"examples/python/objectron/objectron/proto/objectron/proto.py",
# Copied from https://github.com/huggingface/diffusers/blob/fc9fecc217e58d72c0d5796575c72088251ff4df/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py
"examples/python/depth_guided_stable_diffusion/depth_guided_stable_diffusion/huggingface_pipeline.py",
# Copied from https://github.com/colmap/colmap/blob/bf3e19140f491c3042bfd85b7192ef7d249808ec/scripts/python/read_write_model.py
"examples/python/structure_from_motion/structure_from_motion/read_write_model.py",
]
lint.ignore = [
# Missing docstring in public function - TODO(emilk): enable for SDK but not for examples
"D1",
# No blank lines allowed after function docstring.
"D202",
# npydocstyle: http://www.pydocstyle.org/en/stable/error_codes.html
# numpy convention with a few additional lints
"D107",
"D203",
"D212",
"D401",
"D402",
"D415",
"D416",
# Ruff can't fix this error on its own (yet)
# Having ruff check this causes errors that prevent the code-formatting process from completing.
"E501",
# allow relative imports
"TID252",
"UP007", # We need this, or `ruff format` will convert `Union[X, Y]` to `X | Y` which break on Python 3.8
]
line-length = 120
lint.select = [
"D", # pydocstyle codes https://www.pydocstyle.org/en/latest/error_codes.html
"E", # pycodestyle error codes: https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
"F", # Flake8 error codes https://flake8.pycqa.org/en/latest/user/error-codes.html
"I", # Isort
"TID", # flake8-tidy-imports
"W", # pycodestyle warning codes: https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
"UP", # pyupgrade (ensures idomatic code for supported python version)
"PLW1514", # Force setting `encoding` for open calls. This is in order to prevent issues when opening utf8 files on windows where the default encoding may depend on the active locale. https://docs.astral.sh/ruff/rules/unspecified-encoding/
]
lint.unfixable = [
"PLW1514", # Automatic fix for `encoding` doesn't do what we want - it queries the locale for the preferred encoding which is exactly what we want to avoid.
]
[tool.ruff.lint.per-file-ignores]
"docs/snippets/all/*" = [
# Missing required import: `from __future__ import annotations`
"I002",
]
"crates/re_viewer/data/quick_start_guides/*" = [
# Missing required import: `from __future__ import annotations`
"I002",
]
"__init__.py" = ["F401", "F403"]
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
combine-as-imports = true # needed so keep rerun_sdk/__init__.py clean
[tool.maturin]
# We use a python package from inside the rerun_sdk folder to avoid conflicting
# with the other `rerun` pypi package. The rerun_sdk.pth adds this to the pythonpath
# which then allows `import rerun` to work as expected.
# See https://github.com/rerun-io/rerun/pull/1085 for more details
# Even though both `rerun` and `rerun.exe` are here, only one will be included since
# they both should not be fetched in CI when running the build.
# Files missing from this list is not a packaging failure.
include = [
"rerun_sdk.pth",
"rerun_sdk/rerun_cli/rerun",
"rerun_sdk/rerun_cli/rerun.exe",
]
locked = true
name = "rerun_bindings"
python-packages = ["rerun_sdk/rerun", "rerun_sdk/rerun_cli"]
# Setting this to 1 causes lets the build.rs script know we are building a wheel,
# which will cause it to check for the existence of the `rerun` binary.
config = ["env.RERUN_BUILDING_WHEEL=\"1\""]
[tool.pytest.ini_options]
# These conform to Python's Warning Filter syntax:
# https://docs.python.org/3/library/warnings.html#warning-filter
filterwarnings = """
error
"""
norecursedirs = ".* venv* target* build"