DM-55493: Add safir to square_pypi_package dev dependencies - #353
Open
jonathansick wants to merge 1 commit into
Open
DM-55493: Add safir to square_pypi_package dev dependencies#353jonathansick wants to merge 1 commit into
jonathansick wants to merge 1 commit into
Conversation
The generated tests/conftest.py imports safir.testing.data.Data, but the dev extra did not include safir, so a freshly generated package fails at test collection with ModuleNotFoundError. safir>=14.2.0 is the release that introduced safir.testing.data.
Member
|
Oh, this is a good point, we should probably talk about this in the context of our still unresolved question about the role of Safir as a library. I was going to bring that up next week when I'm back at work, since I also want to get the UWS pattern moved onto service discovery, which will require resolving that. I completely forgot that |
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
The
datafixture added to both templates in 9f67f2b importssafir.testing.data.Datain the generatedtests/conftest.py, butsquare_pypi_package'sdevextra lists only coverage, pytest,pytest-asyncio, mypy, documenteer, and scriv — no safir.
A freshly generated package therefore fails at test collection:
fastapi_safir_appis unaffected, since safir is a runtime dependency there.This adds
safir>=14.2.0to thedevextra — 14.2.0 is the release thatintroduced
safir.testing.data.Alternative worth considering
The minimal fix preserves the intent of 9f67f2b, but it does mean every
generated pure-Python package pulls safir into its dev environment purely
for the test-data fixture. If that isn't wanted for a generic PyPI package
template, the other option is to drop the fixture from
square_pypi_packageinstead and keep it infastapi_safir_apponly.Happy to switch this PR to that approach — I picked the one that keeps
the fixture working.
Validation
sconsre-rendered the example; the regeneratedsquare_pypi_package/example/pyproject.tomlis included.templatekit check(with the twotechnote.tomlignores CI uses)passes:
✅ Passed!References
Found while scanning template changes for the lsst-sqre maintenance
catalog. Ticket: DM-55493.