Ignore generated script outputs, fix pytest import, and strip notebook kernelspec metadata - #3
Merged
Conversation
- 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>
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.
Summary
Follow-up cleanup after the Poetry -> uv migration (#2). Three related fixes:
.gitignorefor generated artifacts - Running the scripts inoutput/(and a few one-off report generators) writes data files, images, PDFs, and OpenStudio run outputs to the repo. Added.gitignorerules for these generated paths so they don't get accidentally committed, while keeping the.pyscripts themselves tracked.Fix
pytestimport after uv migration - The Poetry -> uv migration droppedpackages = [{ include = "examples" }], so theexamplespackage was no longer installed into the venv andtests/test_helpers.pyfailed to import it. Addedpythonpath = ["."]to the pytest config inpyproject.tomlrather than reverting the intentionalpackage = falsesetting.Strip notebook kernelspec metadata - Configured the
nbstripoutpre-commit hook to also stripmetadata.kernelspecandmetadata.language_infofrom 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