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
* Check what OS you are running on. Let `BUILT_PY=BUILD_DIR/python` or `BUILD_DIR/python.exe` on macOS.
60
+
* Check what OS you are running on. Let `BUILT_PY=BUILD_DIR/python` or `BUILD_DIR/python.exe` on macOS (.exe is used to avoid a case insensitive fs name conflict)
61
61
* If you are on Windows, ask the user how to build.
62
62
63
63
## Running our built Python and tests
64
64
65
-
* ALWAYS use sub-agents when running tests
65
+
* ALWAYS use sub-agents when running builds or tests
66
66
* NEVER use `pytest`. CPython tests are `unittest` based.
67
67
* use `BUILT_PY` to run the interpreter we've built
68
68
* Individual test files can be run directly using `BUILT_PY Lib/test/test_csv.py`
@@ -71,7 +71,14 @@ ONLY build in a `build/` subdirectory that you create at the repo root.
71
71
*`make -C BUILD_DIR clinic` will regenerate argument clinic generated code. Do this after you've edited a corresponding input .c file in a way that changes a C extension module function signature or docstring
72
72
*`make -C BUILD_DIR test` will run the entire test suite. Do that sparingly. Focus on specific tests first and ask before running the entire test suite.
73
73
* Some tests are packages rather than a single .py file. These require `load_tests()` logic in their `test_package/__init__.py` file in order to work via `BUILT_PY -m test` commands.
74
-
* To collect Python code coverage from part of the test suite, use `BUILD_PY -m test -j $(nproc) --coverage test_name --coveragedir .claude/coverage_dir/`; this uses a `trace` based mechanism as implemented using libregrtest.
74
+
* To collect Python code coverage from part of the test suite, use `BUILT_PY -m test -j $(nproc) --coverage test_name --coveragedir .claude/coverage_dir/`; this uses a `trace` based mechanism as implemented using libregrtest.
75
+
76
+
## Common workflows
77
+
78
+
* After editing C code: `make -C BUILD_DIR && BUILT_PY -m test relevant_tests`
79
+
* After editing stdlib Python: `BUILT_PY -m test relevant_tests --match specific_test_name_glob` (no rebuild needed)
80
+
* After editing .rst documentation: `make -C BUILD_DIR/Doc check`
81
+
* Before committing: `make -C BUILD_DIR patchcheck && pre-commit run --all-files`
75
82
76
83
### Debugging
77
84
@@ -81,10 +88,3 @@ ONLY build in a `build/` subdirectory that you create at the repo root.
81
88
82
89
* NEVER create throw away idea exploration files in the top directory of the repo. Use a `.claude/sandbox/` directory for those. They will never be committed.
83
90
84
-
## Linting
85
-
86
-
*`pre-commit run --all-files`
87
-
* Run these steps from the repo root:
88
-
*`make -C BUILD_DIR patchcheck` should be made to pass before committing.
89
-
* For public documentation changes `make -C Doc check`
0 commit comments