Skip to content

Commit f3a2e08

Browse files
authored
Merge pull request #6 from khnumdev/copilot/fix-readme-format
Fix markdown formatting and add installation instructions in README.md
2 parents 5d3923d + 65cb11c commit f3a2e08

File tree

1 file changed

+55
-25
lines changed

1 file changed

+55
-25
lines changed

README.md

Lines changed: 55 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ pip install local-storage-utils
1414

1515
This installs the `lsu` CLI.
1616

17-
Installing from TestPyPI (for dry-runs)
18-
-------------------------------------
17+
## Installing from TestPyPI (for dry-runs)
1918

2019
If you want to test publishing to TestPyPI and install the package from the test index, prefer doing that inside a virtual environment. This avoids the "externally-managed-environment" / PEP 668 error you saw when trying to install system-wide on Debian/Ubuntu.
2120

@@ -39,21 +38,48 @@ Notes:
3938

4039
## Install (from source)
4140

41+
```bash
4242
git clone <this-repo-url>
4343
cd local-storage-utils
4444
python3 -m venv .venv
4545
source .venv/bin/activate
4646
python -m pip install -U pip
4747
pip install -e .
48+
```
4849

4950
### Troubleshooting local installs
51+
5052
- If you see "Command 'python' not found", use `python3 -m venv .venv` (above). Inside the venv, `python` will point to Python 3.
5153
- If you see "externally-managed-environment", you are attempting a system-wide install. Always install into a virtual environment:
5254
- Create a venv: `python3 -m venv .venv && source .venv/bin/activate`
5355
- Then use the venv pip: `python -m pip install -U pip && pip install -e .`
54-
```bash
55-
sudo apt-get update && sudo apt-get install -y python3-venv
56-
```
56+
57+
#### Installing Python 3 (if not already installed)
58+
59+
**macOS:**
60+
```bash
61+
# Install Python 3 using Homebrew
62+
brew install [email protected]
63+
```
64+
65+
**Linux (Debian/Ubuntu):**
66+
```bash
67+
# Install Python 3 and venv support
68+
sudo apt-get update && sudo apt-get install -y python3 python3-venv python3-pip
69+
```
70+
71+
**Linux (Fedora/RHEL):**
72+
```bash
73+
# Install Python 3 and venv support
74+
sudo dnf install python3 python3-pip
75+
```
76+
77+
**Linux (using Homebrew):**
78+
```bash
79+
# Install Homebrew first (if not already installed): https://brew.sh
80+
# Then install Python 3
81+
brew install [email protected]
82+
```
5783

5884
## Configuration
5985

@@ -92,16 +118,16 @@ log_level: "INFO" # (string) Logging level (DEBUG, INFO, WARNI
92118
93119
The keys above map directly to CLI flags (CLI flags override values in `config.yaml`). Omit any option to use sensible defaults.
94120

95-
# local-storage-utils — Quickstart
121+
## Quickstart
122+
123+
Lightweight utilities for analyzing and cleaning Datastore (Firestore in Datastore mode). Works with the Datastore emulator for local integration testing or GCP when using Application Default Credentials.
96124

97-
Lightweight utilities for analyzing and cleaning Datastore (Firestore in Datastore mode). Works with the
98-
Datastore emulator for local integration testing or GCP when using Application Default Credentials.
125+
### Quick overview
99126

100-
Quick overview
101-
- CLI: run commands via `python3 cli.py <command>` (or install the package and use the entrypoint).
102-
- Makefile: convenience targets are provided to create a venv, install deps, and run tests locally.
127+
- CLI: run commands via `python3 cli.py <command>` (or install the package and use the entrypoint).
128+
- Makefile: convenience targets are provided to create a venv, install deps, and run tests locally.
103129

104-
Quickstart (from source)
130+
### Quickstart (from source)
105131
```bash
106132
git clone <this-repo-url>
107133
cd local-storage-utils
@@ -112,14 +138,15 @@ pip install -U pip
112138
pip install -e .
113139
```
114140

115-
Makefile shortcuts
116-
- `make venv` — create `.venv` and install package in editable mode
117-
- `make unit` — run fast unit tests
118-
- `make integration` — run integration tests (starts/seeds emulator when configured)
141+
### Makefile shortcuts
142+
143+
- `make venv` — create `.venv` and install package in editable mode
144+
- `make unit` — run fast unit tests
145+
- `make integration` — run integration tests (starts/seeds emulator when configured)
119146

120147
Use these targets to get a working dev environment quickly.
121148

122-
Basic CLI examples
149+
### Basic CLI examples
123150
```bash
124151
# list kinds (scans stats or samples)
125152
python3 cli.py analyze-kinds --project my-project
@@ -131,44 +158,47 @@ python3 cli.py analyze-fields --kind MyKind --group-by batchId
131158
python3 cli.py cleanup --ttl-field expireAt --dry-run
132159
```
133160

134-
Configuration
161+
### Configuration
162+
135163
- Local `config.yaml` is supported; CLI flags override config values.
136164
- Example keys: `project_id`, `emulator_host`, `namespaces`, `kinds`, `kind`, `ttl_field`, `batch_size`, `sample_size`, `enable_parallel`.
137165

138-
Emulator & integration testing
166+
### Emulator & integration testing
167+
139168
- Start & seed emulator locally:
140169
- `./scripts/run_emulator_local.sh` (prefers `.venv/bin/python` to run seeder)
141170
- `./scripts/run_emulator_local.sh --no-seed` to skip seeding
142171
- The seeder accepts `SEED_COUNT` and `SEED_NS_COUNT` env vars to increase dataset size for perf tests.
143172

144173
Run integration tests:
174+
145175
```bash
146176
# create venv and install deps (see Quickstart), then:
147177
make integration
148178
```
149179

150-
Development & tests
180+
### Development & tests
181+
151182
- Run unit tests:
152183
- `make unit` (fast)
153184
- Run full test suite locally:
154185
- `make integration`
155186

156-
Publishing
157-
-------
187+
## Publishing
158188

159189
This project uses the `release` workflow to publish releases to PyPI. Follow the packaging tutorial for a complete guide on packaging and publishing: https://packaging.python.org/en/latest/tutorials/packaging-projects/
160190

161191
We support publishing to either TestPyPI (for dry runs) or the real PyPI. The workflow can be triggered automatically on pushes to `main` or manually via the Actions UI (use the "Run workflow" button). When you run it manually you can set the `publish_target` input to `testpypi` to publish to TestPyPI instead of PyPI.
162192

163-
Secrets and tokens
193+
### Secrets and tokens
164194
- For production publishing to the real PyPI, set the repository secret named `PYPI_API_TOKEN` with a PyPI API token.
165195
- For test publishing to TestPyPI, set the repository secret named `TEST_PYPI_API_TOKEN` with a TestPyPI API token.
166196

167197
The release workflow selects the appropriate token based on the `publish_target` input. Use TestPyPI first to validate packaging and metadata before publishing to the real index.
168198

169-
Notes
199+
## Notes
200+
170201
- `sample_size` bounds per-kind/group analysis to avoid scanning entire datasets. Set to 0 or `null` in config to disable sampling.
171202
- `enable_parallel` (default true) enables multi-threaded processing during analysis and deletion; set to false to force single-threaded behavior.
172203

173204
If you'd like a short walkthrough or to change the default Makefile targets, tell me what you'd prefer and I can adjust the README or Makefile.
174-
pip install ruff black

0 commit comments

Comments
 (0)