Skip to content

Commit 552db72

Browse files
committed
some self improvements suggested by Claude
1 parent 953bcfa commit 552db72

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

CLAUDE.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ ONLY build in a `build/` subdirectory that you create at the repo root.
5757
* let `BUILD_DIR=REPO_ROOT/build`
5858
* Setup: `cd BUILD_DIR && ../configure --with-pydebug`
5959
* `make -C BUILD_DIR -j $(nproc)` will rebuild
60-
* 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)
6161
* If you are on Windows, ask the user how to build.
6262

6363
## Running our built Python and tests
6464

65-
* ALWAYS use sub-agents when running tests
65+
* ALWAYS use sub-agents when running builds or tests
6666
* NEVER use `pytest`. CPython tests are `unittest` based.
6767
* use `BUILT_PY` to run the interpreter we've built
6868
* 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.
7171
* `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
7272
* `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.
7373
* 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`
7582

7683
### Debugging
7784

@@ -81,10 +88,3 @@ ONLY build in a `build/` subdirectory that you create at the repo root.
8188

8289
* 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.
8390

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`
90-

0 commit comments

Comments
 (0)