Refactor functions only required by config/utils under config #432
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.
PR Goal?
Triggered by the fact that
everyvoice/utils.py
was importing Pydantic (agreed, I'm probably unreasonable about that), this PR tidies some function definitions:everyvoice/config/utils.py
exists to provide validators, and their definitions depend on five functions that are used nowhere else, so I've moved them all away toeveryvoice/config/validation_helpers.py
.As a welcome side effect,
everyvoice -h
no longer imports Pydantic, but this refactoring has value in and of itself in my opinion.Secondary change: since CI now complains if
everyvoice -h
imports Pydantic, I added an equivalent unit test so we can see it fail locally, earlier, as soon as we cause the issue. I agree banning Pydantic fromeveryvoice -h
might be a bit extreme, though, and am willing to rediscuss.Fixes?
Eric's frustration, plus a bit of technical debt. And passes CI.
Feedback sought?
normal review
Priority?
Tests added?
this code was already well covered
How to test?
Confidence?
high
Version change?
no
Related PRs?
none