| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e46d517 commit 17199b5
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,10 +6,6 @@ glean_code/__pycache__/ | |||
| 6 | 6 | .claude/settings.json | |
| 7 | 7 | git/ | |
| 8 | 8 | ||
| 9 | - # Keeps macOS Spotlight from indexing the repo (stops .pyc/.py name collisions | ||
| 10 | - # with the Glean.app launcher in Cmd+Space) | ||
| 11 | - .metadata_never_index | ||
| 12 | - | ||
| 13 | 9 | # Never commit secrets (tokens may match GLEAN_* or glean_tok_* patterns) | |
| 14 | 10 | .env | |
| 15 | 11 | .env.* | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,12 +10,15 @@ Glean Code is a terminal-first REPL client for the Glean REST API (chat, search, | |||
| 10 | 10 | ||
| 11 | 11 | ```bash | |
| 12 | 12 | # Run the REPL | |
| 13 | - python3 -m glean_code # or ./glean-code | ||
| 13 | + python3 -m glean_code | ||
| 14 | + | ||
| 15 | + # Install it (builds a stdlib-only zipapp; adds a macOS Spotlight app bundle) | ||
| 16 | + python3 install.py # --cli-only, --dev, --prefix, --verify, --uninstall | ||
| 14 | 17 | ||
| 15 | 18 | # Pipe a single command (non-interactive; cli.py detects a non-tty stdin) | |
| 16 | 19 | echo '/search "q2 plan"' | python3 -m glean_code | |
| 17 | 20 | ||
| 18 | - # Run the full test suite (604 tests, stdlib unittest — works with or without pytest) | ||
| 21 | + # Run the full test suite (721 tests, stdlib unittest — works with or without pytest) | ||
| 19 | 22 | python3 -m pytest tests/ | |
| 20 | 23 | python3 -m unittest discover tests/ | |
| 21 | 24 | ||
@@ -27,6 +30,11 @@ python3 -m unittest tests.test_commands.TestParseArgs.test_flag_with_value | |||
| 27 | 30 | ||
| 28 | 31 | There is no build step, no `pip install`, no linter config, and no `pyproject.toml`/`setup.py`. Tests use only the stdlib (`unittest`, `unittest.mock`) and make no network calls. | |
| 29 | 32 | ||
| 33 | + `install.py` is the only thing that produces an artifact: it stages the package in a temp | ||
| 34 | + directory and emits a zipapp, so nothing is ever built inside the repo. On macOS set | ||
| 35 | + `PYTHONPYCACHEPREFIX=~/.cache/python` to keep `__pycache__` out of the working tree — | ||
| 36 | + Spotlight indexes stray `.pyc` files and they hijack Cmd+Space searches for "glean". | ||
| 37 | + | ||
| 30 | 38 | ## Mock vs. live mode (central design idea) | |
| 31 | 39 | ||
| 32 | 40 | Every command works **offline by default**. `Config.effective_mode` resolves to `live` only when a token + instance are present (`auto` mode), otherwise `mock`. The single chokepoint is in [glean_code/client.py](glean_code/client.py): `_post` / `_indexing_post` check `effective_mode` and return `_mock_response(path, body)` / `_mock_indexing_response(path, body)` instead of hitting the network. This means **mock responses are keyed by REST path**, and every new endpoint needs a matching mock shape or it won't work offline (and tests, which run in mock mode, will fail). | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -243,6 +243,13 @@ Or without pytest: | |||
| 243 | 243 | python3 -m unittest discover tests/ | |
| 244 | 244 | ``` | |
| 245 | 245 | ||
| 246 | + On macOS, keep bytecode caches out of the working tree — Spotlight indexes stray `.pyc` | ||
| 247 | + files, and they outrank the `Glean.app` launcher in `Cmd+Space`: | ||
| 248 | + | ||
| 249 | + ```bash | ||
| 250 | + export PYTHONPYCACHEPREFIX="$HOME/.cache/python" | ||
| 251 | + ``` | ||
| 252 | + | ||
| 246 | 253 | 721 tests covering the client and every mock response, commands and dispatch, config, UI, auth, completion, help docs, the mock corpus, indexing-walk, scaffold, the installer, and the MCP server. Development notes: [docs/TESTING.md](docs/TESTING.md). | |
| 247 | 254 | ||
| 248 | 255 | ## Documentation | |
| Back | FazBrowse Home | New Git URL |
0 commit comments