Skip to content

Commit 5929920

Browse files
committed
⬆️ chore: standardize on Python 3.13
Org-wide standardization on Python 3.13 (3.13 rather than 3.14 because whisperx in a sibling repo caps at <3.14). - Add .python-version pinning 3.13 - README + CLAUDE.md: document 3.13 and switch setup/run commands to uv - Note the extractors' write-to-CWD behavior so verification runs don't clobber the committed JSON No pyproject.toml exists here, so there is no requires-python to change. Verified on 3.13: PyMuPDF 1.28.0 resolves; both extractors regenerate output byte-identical to the committed JSON (diff clean, sha256 match); nist_sorter reports ordering already correct; all 11 tracked .py files compile. No test suite and no CI exist in this repo.
1 parent 6ed2dfc commit 5929920

3 files changed

Lines changed: 31 additions & 11 deletions

File tree

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

CLAUDE.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,30 @@ This is a web application for viewing and managing security control overlays tha
1515
## Common Development Commands
1616

1717
### Python Data Extraction
18+
19+
Python 3.13 (pinned in `.python-version`), managed with `uv`. Never use bare `pip` or conda.
20+
1821
```bash
22+
# One-time environment setup
23+
uv venv --python 3.13
24+
uv pip install -r requirements.txt
25+
1926
# Extract overlay data from PDFs (requires PyMuPDF/fitz)
20-
python cnssi_1253/extract_cnssi_1253.py cnssi_1253/CNSSI_1253_2022.pdf
21-
python classified_information/extract_classified_information.py classified_information/classified_information_overlay_2022.pdf
27+
uv run python cnssi_1253/extract_cnssi_1253.py cnssi_1253/CNSSI_1253_2022.pdf
28+
uv run python classified_information/extract_classified_information.py classified_information/classified_information_overlay_2022.pdf
2229

2330
# Debug specific pages
24-
python cnssi_1253/extract_cnssi_1253.py cnssi_1253/CNSSI_1253_2022.pdf --debug-page 10
31+
uv run python cnssi_1253/extract_cnssi_1253.py cnssi_1253/CNSSI_1253_2022.pdf --debug-page 10
2532

2633
# Sort NIST controls naturally
27-
python nist_catalog/nist_sorter.py input.json output.json
34+
uv run python nist_catalog/nist_sorter.py input.json output.json
2835
```
2936

37+
**Extractor output paths:** `extract_*.py` write their JSON to the *current working directory* using hardcoded
38+
filenames, so run them from the repo root to land on the committed files. `nist_sorter.py` overwrites its input
39+
file when no output path is given. When regenerating output just to verify a change, run from a scratch
40+
directory so the committed JSON is never clobbered, then `diff` the result.
41+
3042
### Development
3143
- No build process - edit `index.html` directly
3244
- No package manager - pure vanilla JavaScript
@@ -93,6 +105,6 @@ No automated tests exist. Manual testing process:
93105

94106
## Dependencies
95107

96-
- **Python**: PyMuPDF (fitz) for PDF extraction
108+
- **Python**: 3.13, PyMuPDF (fitz) for PDF extraction (see `requirements.txt`)
97109
- **JavaScript**: None (vanilla JS only)
98110
- **Deployment**: GitHub Pages

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,26 @@ The application uses a PDF → JSON → Web pipeline:
108108

109109
### Extracting Data from PDFs
110110

111+
The extractors target **Python 3.13** (pinned in `.python-version`) and depend on PyMuPDF (fitz). Set up the environment with [uv](https://docs.astral.sh/uv/):
112+
111113
```bash
112-
# Requires PyMuPDF (fitz)
113-
pip install PyMuPDF
114+
# Create the environment and install dependencies
115+
uv venv --python 3.13
116+
uv pip install -r requirements.txt
117+
```
114118

119+
The extractor scripts write their JSON output to the **current working directory**, so run them from the repository root:
120+
121+
```bash
115122
# Extract CNSSI 1253 overlay
116-
python cnssi_1253/extract_cnssi_1253.py cnssi_1253/CNSSI_1253_2022.pdf
123+
uv run python cnssi_1253/extract_cnssi_1253.py cnssi_1253/CNSSI_1253_2022.pdf
117124

118125
# Extract Classified Information overlay
119-
python classified_information/extract_classified_information.py \
126+
uv run python classified_information/extract_classified_information.py \
120127
classified_information/classified_information_overlay_2022.pdf
121128

122129
# Debug specific pages
123-
python cnssi_1253/extract_cnssi_1253.py cnssi_1253/CNSSI_1253_2022.pdf --debug-page 10
130+
uv run python cnssi_1253/extract_cnssi_1253.py cnssi_1253/CNSSI_1253_2022.pdf --debug-page 10
124131
```
125132

126133
---
@@ -192,7 +199,7 @@ The site is deployed at [https://il6.sl5taskforce.org/](https://il6.sl5taskforce
192199
| Component | Dependency |
193200
|-----------|------------|
194201
| **Web App** | None (vanilla JavaScript) |
195-
| **PDF Extraction** | Python 3, PyMuPDF (`pip install PyMuPDF`) |
202+
| **PDF Extraction** | Python 3.13, PyMuPDF (`uv pip install -r requirements.txt`) |
196203
| **Deployment** | GitHub Pages |
197204

198205
---

0 commit comments

Comments
 (0)