Spaces:
Sleeping
Sleeping
Eric Putnam commited on
Commit ·
4367a4a
1
Parent(s): b8cee79
fedstylevalidator in PyPI
Browse files- Dockerfile +0 -6
- PRD.md +5 -9
- README.md +8 -19
- docs/ai-notes.md +18 -10
- pyproject.toml +3 -0
- requirements-space.txt +1 -0
- requirements.txt +2 -6
Dockerfile
CHANGED
|
@@ -1,8 +1,5 @@
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
-
RUN apt-get update && apt-get install -y --no-install-recommends git \
|
| 4 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 5 |
-
|
| 6 |
RUN useradd -m -u 1000 user
|
| 7 |
|
| 8 |
USER user
|
|
@@ -19,9 +16,6 @@ COPY --chown=user requirements-space.txt ./
|
|
| 19 |
RUN pip install --no-cache-dir --upgrade pip \
|
| 20 |
&& pip install --no-cache-dir -r requirements-space.txt
|
| 21 |
|
| 22 |
-
RUN --mount=type=secret,id=FEDSTYLEVALIDATOR_GIT_URL,mode=0444,required=true \
|
| 23 |
-
pip install --no-cache-dir "fedstylevalidator @ $(cat /run/secrets/FEDSTYLEVALIDATOR_GIT_URL)"
|
| 24 |
-
|
| 25 |
COPY --chown=user . .
|
| 26 |
|
| 27 |
EXPOSE 7860
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
|
|
|
|
|
|
|
|
|
| 3 |
RUN useradd -m -u 1000 user
|
| 4 |
|
| 5 |
USER user
|
|
|
|
| 16 |
RUN pip install --no-cache-dir --upgrade pip \
|
| 17 |
&& pip install --no-cache-dir -r requirements-space.txt
|
| 18 |
|
|
|
|
|
|
|
|
|
|
| 19 |
COPY --chown=user . .
|
| 20 |
|
| 21 |
EXPOSE 7860
|
PRD.md
CHANGED
|
@@ -230,16 +230,12 @@ font = "sans serif"
|
|
| 230 |
|
| 231 |
**`requirements.txt`** minimum:
|
| 232 |
```
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
# or: fedstylevalidator @ file:///path/to/local/FedStyleValidator
|
| 236 |
-
#
|
| 237 |
-
# Switch to plain `fedstylevalidator` once published.
|
| 238 |
-
fedstylevalidator
|
| 239 |
-
streamlit>=1.32.0
|
| 240 |
```
|
| 241 |
|
| 242 |
-
> **
|
|
|
|
| 243 |
|
| 244 |
---
|
| 245 |
|
|
@@ -264,7 +260,7 @@ streamlit>=1.32.0
|
|
| 264 |
|
| 265 |
| # | Question | Decision |
|
| 266 |
|---|----------|----------|
|
| 267 |
-
| 1 | FSV pip availability |
|
| 268 |
| 2 | NLTK corpora at startup | Unknown — needs a test deploy. If NLTK download hangs the HF Space build, add a `packages.txt` or a startup script that pre-downloads corpora. |
|
| 269 |
| 3 | File size / HF timeout | Hard limit: **20 MB**, enforced before calling FSV. Use `st.spinner` for progress feedback during the synchronous FSV call. |
|
| 270 |
| 4 | Hyperlink check latency | Sidebar toggle **"Check external links"**, default **off**. Users who need it opt in; everyone else avoids the 30–60s penalty and HF timeout risk. |
|
|
|
|
| 230 |
|
| 231 |
**`requirements.txt`** minimum:
|
| 232 |
```
|
| 233 |
+
fedstylevalidator==0.1.0
|
| 234 |
+
streamlit==1.56.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 235 |
```
|
| 236 |
|
| 237 |
+
> **Update (April 11, 2026):** FSV 0.1.0 is now on PyPI, so this repo can use a
|
| 238 |
+
> normal `pip install fedstylevalidator==0.1.0` dependency flow.
|
| 239 |
|
| 240 |
---
|
| 241 |
|
|
|
|
| 260 |
|
| 261 |
| # | Question | Decision |
|
| 262 |
|---|----------|----------|
|
| 263 |
+
| 1 | FSV pip availability | Published to PyPI on April 11, 2026. Pin `fedstylevalidator==0.1.0` in `requirements.txt`. |
|
| 264 |
| 2 | NLTK corpora at startup | Unknown — needs a test deploy. If NLTK download hangs the HF Space build, add a `packages.txt` or a startup script that pre-downloads corpora. |
|
| 265 |
| 3 | File size / HF timeout | Hard limit: **20 MB**, enforced before calling FSV. Use `st.spinner` for progress feedback during the synchronous FSV call. |
|
| 266 |
| 4 | Hyperlink check latency | Sidebar toggle **"Check external links"**, default **off**. Users who need it opt in; everyone else avoids the 30–60s penalty and HF timeout risk. |
|
README.md
CHANGED
|
@@ -3,8 +3,9 @@ title: FAA Document Checker (FSV)
|
|
| 3 |
emoji: "✈"
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: indigo
|
| 6 |
-
sdk:
|
| 7 |
-
|
|
|
|
| 8 |
pinned: false
|
| 9 |
license: mit
|
| 10 |
---
|
|
@@ -17,28 +18,16 @@ browser-based dashboard.
|
|
| 17 |
|
| 18 |
## Hugging Face Deployment
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
Before rebuilding on Hugging Face, add this Space secret in Settings:
|
| 24 |
-
|
| 25 |
-
- `FEDSTYLEVALIDATOR_GIT_URL`
|
| 26 |
-
|
| 27 |
-
Set the secret value to an authenticated Git URL for the private FSV
|
| 28 |
-
repository, for example:
|
| 29 |
-
|
| 30 |
-
```text
|
| 31 |
-
git+https://<github-username>:<github-token>@github.com/eputnam77/FedStyleValidator.git
|
| 32 |
-
```
|
| 33 |
-
|
| 34 |
-
The Docker build mounts that secret only at build time and installs
|
| 35 |
-
`fedstylevalidator` from it.
|
| 36 |
|
| 37 |
## Local Development
|
| 38 |
|
| 39 |
-
Install the dependencies, then run:
|
| 40 |
|
| 41 |
```bash
|
|
|
|
| 42 |
streamlit run app.py
|
| 43 |
```
|
| 44 |
|
|
|
|
| 3 |
emoji: "✈"
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: indigo
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: "1.56.0"
|
| 8 |
+
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
---
|
|
|
|
| 18 |
|
| 19 |
## Hugging Face Deployment
|
| 20 |
|
| 21 |
+
`fedstylevalidator` 0.1.0 was published to PyPI on April 11, 2026, so this
|
| 22 |
+
Space can use the standard Streamlit SDK again. No build secret or Docker-only
|
| 23 |
+
install path is required.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
## Local Development
|
| 26 |
|
| 27 |
+
Install the pinned dependencies, then run:
|
| 28 |
|
| 29 |
```bash
|
| 30 |
+
pip install -r requirements.txt
|
| 31 |
streamlit run app.py
|
| 32 |
```
|
| 33 |
|
docs/ai-notes.md
CHANGED
|
@@ -11,6 +11,14 @@ Running decisions and context for Claude Code sessions. Update as work progresse
|
|
| 11 |
- Note: older sections below contain scaffold-era notes and do not fully reflect
|
| 12 |
the current implementation.
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
## 2026-04-10 Implementation Update
|
| 15 |
|
| 16 |
- Added the first runnable Streamlit app scaffold: `app.py`, `requirements.txt`,
|
|
@@ -27,11 +35,10 @@ Running decisions and context for Claude Code sessions. Update as work progresse
|
|
| 27 |
does not expose a link-only suppression flag, so the control is informational
|
| 28 |
for now.
|
| 29 |
- Verification completed: `ruff check .` and `python -m py_compile ...`.
|
| 30 |
-
- Hugging Face deployment moved to a Docker Space because the
|
| 31 |
-
`FedStyleValidator` repository
|
| 32 |
-
built-in Streamlit Space builder.
|
| 33 |
-
|
| 34 |
-
`git+https://...` URL for the FSV repository.
|
| 35 |
- Added an initial pytest suite under `tests/` that stubs `streamlit` and
|
| 36 |
`fedstylevalidator` so the wrapper can be tested without the real dependency
|
| 37 |
stack. Coverage now includes upload validation, temp-file handling, export
|
|
@@ -43,14 +50,15 @@ Running decisions and context for Claude Code sessions. Update as work progresse
|
|
| 43 |
- **No pack-selection UI** — all FSV packs run by default (`check_packs=None`).
|
| 44 |
- **20 MB file size limit** enforced in app before calling FSV.
|
| 45 |
- **Hyperlink check** is off by default (sidebar toggle) due to 30–60s latency risk on HF Spaces.
|
| 46 |
-
- **FSV
|
| 47 |
-
|
| 48 |
-
|
|
|
|
| 49 |
|
| 50 |
## Architecture
|
| 51 |
|
| 52 |
-
- `app.py` — Streamlit entry point
|
| 53 |
-
- `requirements.txt` — `fedstylevalidator` + `streamlit
|
| 54 |
- `.streamlit/config.toml` — theme (FAA blue `#003087`) + 50 MB upload limit
|
| 55 |
- `README.md` — HF Space YAML front-matter + usage docs
|
| 56 |
|
|
|
|
| 11 |
- Note: older sections below contain scaffold-era notes and do not fully reflect
|
| 12 |
the current implementation.
|
| 13 |
|
| 14 |
+
## 2026-04-11 Packaging Update
|
| 15 |
+
|
| 16 |
+
- `fedstylevalidator` 0.1.0 was published to PyPI on April 11, 2026.
|
| 17 |
+
- `requirements.txt` now pins `fedstylevalidator==0.1.0` and
|
| 18 |
+
`streamlit==1.56.0`.
|
| 19 |
+
- The Hugging Face deployment path no longer needs a private Git URL or build
|
| 20 |
+
secret and is back on the standard Streamlit Space configuration.
|
| 21 |
+
|
| 22 |
## 2026-04-10 Implementation Update
|
| 23 |
|
| 24 |
- Added the first runnable Streamlit app scaffold: `app.py`, `requirements.txt`,
|
|
|
|
| 35 |
does not expose a link-only suppression flag, so the control is informational
|
| 36 |
for now.
|
| 37 |
- Verification completed: `ruff check .` and `python -m py_compile ...`.
|
| 38 |
+
- Hugging Face deployment temporarily moved to a Docker Space because the
|
| 39 |
+
private `FedStyleValidator` repository could not be installed anonymously by
|
| 40 |
+
the built-in Streamlit Space builder. That workaround is obsolete now that
|
| 41 |
+
`fedstylevalidator` 0.1.0 is published on PyPI.
|
|
|
|
| 42 |
- Added an initial pytest suite under `tests/` that stubs `streamlit` and
|
| 43 |
`fedstylevalidator` so the wrapper can be tested without the real dependency
|
| 44 |
stack. Coverage now includes upload validation, temp-file handling, export
|
|
|
|
| 50 |
- **No pack-selection UI** — all FSV packs run by default (`check_packs=None`).
|
| 51 |
- **20 MB file size limit** enforced in app before calling FSV.
|
| 52 |
- **Hyperlink check** is off by default (sidebar toggle) due to 30–60s latency risk on HF Spaces.
|
| 53 |
+
- **FSV packaging** — use the published PyPI package and pin
|
| 54 |
+
`fedstylevalidator==0.1.0`.
|
| 55 |
+
- **HF deployment path** - use the standard Streamlit Space configuration now
|
| 56 |
+
that the dependency is public.
|
| 57 |
|
| 58 |
## Architecture
|
| 59 |
|
| 60 |
+
- `app.py` — Streamlit entry point
|
| 61 |
+
- `requirements.txt` — `fedstylevalidator==0.1.0` + `streamlit==1.56.0`
|
| 62 |
- `.streamlit/config.toml` — theme (FAA blue `#003087`) + 50 MB upload limit
|
| 63 |
- `README.md` — HF Space YAML front-matter + usage docs
|
| 64 |
|
pyproject.toml
CHANGED
|
@@ -8,3 +8,6 @@ select = ["E", "F", "W", "I"]
|
|
| 8 |
[tool.ruff.format]
|
| 9 |
quote-style = "double"
|
| 10 |
indent-style = "space"
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
[tool.ruff.format]
|
| 9 |
quote-style = "double"
|
| 10 |
indent-style = "space"
|
| 11 |
+
|
| 12 |
+
[tool.pytest.ini_options]
|
| 13 |
+
testpaths = ["tests"]
|
requirements-space.txt
CHANGED
|
@@ -1 +1,2 @@
|
|
|
|
|
| 1 |
streamlit==1.56.0
|
|
|
|
| 1 |
+
fedstylevalidator==0.1.0
|
| 2 |
streamlit==1.56.0
|
requirements.txt
CHANGED
|
@@ -1,6 +1,2 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
fedstylevalidator @ git+https://github.com/eputnam77/FedStyleValidator.git
|
| 4 |
-
# Alternative for a sibling checkout:
|
| 5 |
-
# fedstylevalidator @ file:///C:/dev/FedStyleValidator
|
| 6 |
-
streamlit>=1.32.0
|
|
|
|
| 1 |
+
fedstylevalidator==0.1.0
|
| 2 |
+
streamlit==1.56.0
|
|
|
|
|
|
|
|
|
|
|
|