Spaces:
Running
Running
Claude commited on
fix: CSS non appliqué — packaging static + cache-buster
Browse files3 causes du CSS non visible :
1. package-data manquant : setuptools n'incluait pas web/static/*.css
dans le package installé. Ajout de [tool.setuptools.package-data]
dans pyproject.toml.
2. MANIFEST.in incomplet : les .css n'étaient pas dans les sdist.
Ajout de recursive-include picarones/web/static *.css.
3. Cache navigateur : le lien CSS est maintenant versionné avec
?v=__VERSION__ remplacé dynamiquement par la version du package
à chaque requête, forçant le rechargement après mise à jour.
https://claude.ai/code/session_01UtY7QGAcj2M7pAyU2nvzvn
- MANIFEST.in +1 -0
- picarones/web/app.py +2 -2
- pyproject.toml +3 -0
MANIFEST.in
CHANGED
|
@@ -3,4 +3,5 @@ include README.md
|
|
| 3 |
include CHANGELOG.md
|
| 4 |
include CLAUDE.md
|
| 5 |
recursive-include picarones/prompts *.txt
|
|
|
|
| 6 |
recursive-include picarones *.json *.yaml *.yml
|
|
|
|
| 3 |
include CHANGELOG.md
|
| 4 |
include CLAUDE.md
|
| 5 |
recursive-include picarones/prompts *.txt
|
| 6 |
+
recursive-include picarones/web/static *.css
|
| 7 |
recursive-include picarones *.json *.yaml *.yml
|
picarones/web/app.py
CHANGED
|
@@ -1560,7 +1560,7 @@ async def index(picarones_lang: str = Cookie(default="fr")) -> HTMLResponse:
|
|
| 1560 |
"<head>",
|
| 1561 |
f'<head>\n<meta name="picarones-lang" content="{lang}">',
|
| 1562 |
1,
|
| 1563 |
-
)
|
| 1564 |
return HTMLResponse(content=page)
|
| 1565 |
|
| 1566 |
|
|
@@ -1582,7 +1582,7 @@ _HTML_TEMPLATE = r"""<!DOCTYPE html>
|
|
| 1582 |
<meta charset="UTF-8">
|
| 1583 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 1584 |
<title>Picarones — OCR Benchmark</title>
|
| 1585 |
-
<link rel="stylesheet" href="/static/retro.css">
|
| 1586 |
<style>
|
| 1587 |
/* Overrides locaux minimaux — le gros du CSS est dans /static/retro.css */
|
| 1588 |
</style>
|
|
|
|
| 1560 |
"<head>",
|
| 1561 |
f'<head>\n<meta name="picarones-lang" content="{lang}">',
|
| 1562 |
1,
|
| 1563 |
+
).replace("__VERSION__", __version__)
|
| 1564 |
return HTMLResponse(content=page)
|
| 1565 |
|
| 1566 |
|
|
|
|
| 1582 |
<meta charset="UTF-8">
|
| 1583 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 1584 |
<title>Picarones — OCR Benchmark</title>
|
| 1585 |
+
<link rel="stylesheet" href="/static/retro.css?v=__VERSION__">
|
| 1586 |
<style>
|
| 1587 |
/* Overrides locaux minimaux — le gros du CSS est dans /static/retro.css */
|
| 1588 |
</style>
|
pyproject.toml
CHANGED
|
@@ -73,6 +73,9 @@ picarones = "picarones.cli:cli"
|
|
| 73 |
where = ["."]
|
| 74 |
include = ["picarones*"]
|
| 75 |
|
|
|
|
|
|
|
|
|
|
| 76 |
[tool.pytest.ini_options]
|
| 77 |
testpaths = ["tests"]
|
| 78 |
addopts = "-v --tb=short"
|
|
|
|
| 73 |
where = ["."]
|
| 74 |
include = ["picarones*"]
|
| 75 |
|
| 76 |
+
[tool.setuptools.package-data]
|
| 77 |
+
picarones = ["prompts/*.txt", "web/static/*.css"]
|
| 78 |
+
|
| 79 |
[tool.pytest.ini_options]
|
| 80 |
testpaths = ["tests"]
|
| 81 |
addopts = "-v --tb=short"
|