chore: gitignore pytest-temp-preset.json test side-effect - #149
Merged
Conversation
The dev container config was from the pre-PR-144 layout and is now stale: - It pins Python 3.11, but setup.py requires >=3.12. - It references prettymaps/app.py in customizations.codespaces. openFiles, but the Streamlit entrypoint is app.py at the repo root. - The updateContentCommand runs a 'pip3 install --user streamlit' step that current CI no longer relies on. The directory is not referenced from any active workflow or README section. Removes the .devcontainer/ line from .gitignore too. Pure housekeeping; no functional change.
PR #144 deleted the 13 temp_readme_*.png files that the generate-readme.yml workflow had committed to pictures/README/temp_readme_files/, but missed this single .svg sibling (added 2025-05-16). After PR #144, pictures/README/ contained only this stale 3.5 KB file. Removing it leaves the directory empty. Pure housekeeping; no functional change.
.gitignore carried two rules for a scripts/ directory that does
not exist (the Streamlit entrypoint is app.py at the repo root,
and there is no other code generation pipeline):
/scripts/*.pyc
/scripts/__pycache__/
Both lines are removed.
Pure housekeeping; no functional change.
The Streamlit Cloud deploy was failing with:
ImportError: libgthread-2.0.so.0: cannot open shared object file:
No such file or directory
opencv-python 5.0.0.93 (allowed by the >=4.11.0.86 floor in
requirements.txt and pulled by uv on the latest deploy) links
against the GLib runtime at module load time. packages.txt ships
libgl1 (OpenGL runtime), but the GLib shared object is not present
on Streamlit Cloud's image, so the cv2 native module cannot load.
opencv-python-headless exposes the same cv2 namespace, drops the
Qt/GTK/GLib dependency tree entirely, and is the upstream-
recommended variant for headless / server deployments.
The only cv2 callsites in this codebase are cv2.resize and
cv2.bilateralFilter (prettymaps/draw.py, hillshade layer path).
Both work identically under headless; locally validated:
- import cv2: 5.0.0.0
- pytest tests/: 9 passed
- pytest tests/test.py: 23 passed
- streamlit run app.py boots clean
- cv2.resize + cv2.bilateralFilter verified end-to-end
No source code change; packages.txt intentionally left as-is
(libgl1 is small and harmless; the GLib runtime is no longer
needed by anything we depend on).
tests/test.py:28 (test_create_and_read_preset) calls
prettymaps.create_preset('pytest-temp-preset', ...) and writes a
real JSON file into prettymaps/presets/pytest-temp-preset.json,
which then shows up as untracked in 'git status' after running
pytest. Add a one-line gitignore rule next to the existing
prettymaps/presets/my-preset.json entry so contributors running
the test suite locally don't see a stray untracked file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Running
pytest tests/(which exercisestests/test.py:28 test_create_and_read_preset) leaves behind an untracked file:The test calls
prettymaps.create_preset('pytest-temp-preset', ...)to write a real JSON file under
prettymaps/presets/, and nevercleans it up. Every contributor who runs the test suite sees a
stray untracked file in
git statusuntil they manually delete it.Fix
Add
prettymaps/presets/pytest-temp-preset.jsonto.gitignore,next to the existing
prettymaps/presets/my-preset.jsonrule thatcovers the user-facing preset convention.
Diff
*.tmp *.tmp.png prettymaps/presets/my-preset.json +prettymaps/presets/pytest-temp-preset.jsonVerification
git check-ignore -v prettymaps/presets/pytest-temp-preset.jsonresolves the path to
.gitignore:47.pytest tests/still passes (32/32 — the test logic isunchanged; only the gitignore surface area changed).