Skip to content

Ignore generated script outputs, fix pytest import, and strip notebook kernelspec metadata - #3

Merged
nllong merged 5 commits into
developfrom
migrate-to-uv
Jul 23, 2026
Merged

Ignore generated script outputs, fix pytest import, and strip notebook kernelspec metadata#3
nllong merged 5 commits into
developfrom
migrate-to-uv

Conversation

@nllong

@nllong nllong commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up cleanup after the Poetry -> uv migration (#2). Three related fixes:

  1. .gitignore for generated artifacts - Running the scripts in output/ (and a few one-off report generators) writes data files, images, PDFs, and OpenStudio run outputs to the repo. Added .gitignore rules for these generated paths so they don't get accidentally committed, while keeping the .py scripts themselves tracked.

  2. Fix pytest import after uv migration - The Poetry -> uv migration dropped packages = [{ include = "examples" }], so the examples package was no longer installed into the venv and tests/test_helpers.py failed to import it. Added pythonpath = ["."] to the pytest config in pyproject.toml rather than reverting the intentional package = false setting.

  3. Strip notebook kernelspec metadata - Configured the nbstripout pre-commit hook to also strip metadata.kernelspec and metadata.language_info from notebooks, since these pin a specific local Python/ipykernel version and cause needless diffs across environments/machines. Applied the same stripping to the two existing example notebooks.

Testing

  • uv run pytest -q - all 8 tests pass.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Nicholas Long and others added 5 commits July 22, 2026 19:28
- Add .gitignore rules for local scratch artifacts produced by running
  the output/ scripts (data, images, pdfs, openstudio run outputs) and
  a handful of one-off generated report files at the repo root, while
  keeping the .py scripts themselves tracked.
- Restore examples.* importability in tests: the Poetry -> uv migration
  dropped `packages = [{ include = "examples" }]`, so `examples` was no
  longer installed into the venv and tests/test_helpers.py failed to
  import it. Add `pythonpath = ["."]` to pytest config instead of
  reverting the intentional `package = false` setting.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Configure the nbstripout pre-commit hook to also strip
metadata.kernelspec and metadata.language_info from notebooks (these
pin a specific local Python/ipykernel version and cause needless
diffs across environments), and drop that metadata from the two
example notebooks to match.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nllong
nllong merged commit 82b2204 into develop Jul 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant