You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,12 @@ Key technical traits: async-first (tokio), Arrow-native, versioned writes with m
46
46
47
47
See [python/AGENTS.md](python/AGENTS.md) and [java/AGENTS.md](java/AGENTS.md).
48
48
49
+
## Language-Specific Environment Contract
50
+
51
+
- For language-specific tasks, always follow the environment and command rules in the corresponding subdirectory guide before running build, test, lint, format, or tooling commands.
52
+
- Do not substitute a different environment manager or toolchain just because a command appears missing, unavailable, or slow.
53
+
- If a language-specific command fails outside the documented workflow, treat that as an environment usage mistake first. Fix the environment usage, rerun with the prescribed commands, and only then conclude that a dependency or tool is unavailable.
Copy file name to clipboardExpand all lines: python/AGENTS.md
+18-9Lines changed: 18 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,19 @@ Also see [root AGENTS.md](../AGENTS.md) for cross-language standards.
4
4
5
5
## Commands
6
6
7
-
* Environment: prefer `uv` for local Python environment setup; start with `uv sync --extra tests --extra dev`, and add other extras such as `benchmarks`, `torch`, or `geo` only when needed.
8
-
* Command execution: after initializing the environment with `uv`, either activate the environment or use `uv run ...`; keep `Makefile` targets and CI commands environment-manager agnostic unless CI has been migrated explicitly.
9
-
* Build time expectations: `uv sync` and `uv run maturin develop` build the local `pylance` Rust extension as part of the environment workflow. This can be slow, especially on the first run or after Rust dependency changes; treat that as expected and do not switch to a different environment manager just because the build takes time.
10
-
* Build: `maturin develop` (required after Rust changes)
11
-
* Test: `make test`
12
-
* Run single test: `pytest python/tests/<test_file>.py::<test_name>`
13
-
* Doctest: `make doctest`
14
-
* Lint: `make lint`
15
-
* Format: `make format`
7
+
* Environment: use `uv` for all local Python environment setup in this repository.
8
+
* First step in every new worktree or fresh checkout: run `uv sync --extra tests --extra dev` from `python/` before any Python command. Add other extras such as `benchmarks`, `torch`, or `geo` only when needed.
9
+
*`uv sync` builds the local `pylance` Rust extension as part of environment setup. This can take a long time. Start it early, let it finish, and do not interrupt it or switch to a different setup path just because the build is slow.
10
+
* Command execution: always use `uv run ...` for Python-related repository commands. Do not rely on a globally activated environment.
11
+
* Never invoke bare `python`, `pytest`, `pip`, `maturin`, `make test`, `make doctest`, `make lint`, or `make format` for repository work.
12
+
* If a Python command fails outside `uv run`, that does not count as a dependency or test failure. Fix the environment usage first and rerun correctly.
13
+
* Build time expectations: `uv sync` and `uv run maturin develop` build the local `pylance` Rust extension as part of the environment workflow. This can be slow, especially on the first run or after Rust dependency changes; treat that as expected and do not switch to a different environment manager or shortcut around the build just because it takes time.
14
+
* Build: `uv run maturin develop` (required after Rust changes)
15
+
* Test: `uv run make test`
16
+
* Run single test: `uv run pytest python/tests/<test_file>.py::<test_name>`
17
+
* Doctest: `uv run make doctest`
18
+
* Lint: `uv run make lint`
19
+
* Format: `uv run make format`
16
20
17
21
## API Design
18
22
@@ -26,3 +30,8 @@ Also see [root AGENTS.md](../AGENTS.md) for cross-language standards.
26
30
- Use `@pytest.mark.parametrize` for tests that differ only in inputs — extract shared setup into helpers.
27
31
- Add tests to existing `test_{module}.py` files rather than creating new test files for the same module.
28
32
- Replace `print()` in tests with `assert` statements.
33
+
34
+
## Common Failure Mode
35
+
36
+
- A missing module or missing command error from bare `python`, `pytest`, `pip`, `maturin`, or `make` is usually an environment usage mistake, not a repository issue.
37
+
- Before reporting a Python dependency as unavailable, verify that `uv sync --extra tests --extra dev` has been run in the current worktree and that the failing command was executed with `uv run ...`.
0 commit comments