Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true
},
"[go]": {
"editor.defaultFormatter": "golang.go",
"editor.formatOnSave": true
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,16 @@ Following options are enabled:
- The `-p no:warnings` option will suppress and allow warnings.

```sh
uv pip install pytest pytest-repeat numpy # for repeated fuzzy tests
uv pip install -e . --group tests # for repeated fuzzy tests
python -m pytest # if you trust the default settings
python -m pytest python/scripts/ -s -x -p no:warnings # to overwrite the default settings
```

Linting:

```sh
pip install ruff
ruff --format=github --select=E9,F63,F7,F82 --target-version=py310 python
uv pip install -e . --group lint
ruff --format=github python
```

Before merging your changes you may want to test your changes against the entire matrix of Python versions USearch supports.
Expand Down
29 changes: 24 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,27 @@ before-build = [
"git submodule update --init --recursive",
]

# Configuration options for the Black formatter:
# https://black.readthedocs.io/en/latest/usage_and_configuration/the_basics.html#where-black-looks-for-the-file
[tool.black]
line-length = 120 # Set line length to the same value as in `.clang-format` for modern wide screens
target-version = ['py36', 'py314']
[dependency-groups]
lint = [
"ruff>=0.15.8",
]
tests = [
"numpy>=1.21",
"pytest>=9.0.2",
"pytest-repeat>=0.9.4",
]

[tool.ruff]
line-length = 120
target-version = "py310"

[tool.ruff.format]
quote-style = "double"

[tool.ruff.lint]
select = [
"E9",
"F63",
"F7",
"F82",
]