-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: The pytest rework no-one asked for, adjustment to packaging behavior #17
Merged
Conversation
This file contains 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
In the spirit of isolating comfyui imported behavior, which the 3rd party modules ultimately are, this change helps isolate any traps or pitfalls when it comes to importing modules, particularly with pytest.
As covered in my dissertation in `comfy_horde.py` (see diff), this change supports a more flexible scheme allowing pytest discovery to not be so problematic outside of tox.
I have testing in mind when doing this, but there could be other reasons for doing this.
The rationale here is to avoid any tricks to be required re: pytest discovery. The tox test is correspondingly updated
@jug-dev Can you confirm this doesn't introduce any breaking changes to your desired development (code) workflow, when you have the time. I will defer merging until we can agree that there are no systemic changes that will seriously disrupt the way you were developing code. |
@tazlin Nice. LGTM. No problems with merging this from my point of view. |
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.
Of note:
comfy_horde.py
now imports OK withouthordelib.initialise()
being calledComfy_Horde
will throw a characteristic exception explaininghordelib.initialise()
must be called.tests/meta/test_packaging_errors.py
, now ensures the behavior is present.comfy_horde.py
.tests/__init__.py
now empty;tests/conftest.py
now used.Which can be used like so (as seen in
test_horde_samplers
):ShareModelManager
for type hinting (or any other purpose).Cosine image similarity
tests/testing_shared_functions.py
.LORA_SIMILARITY_DEFAULTS
).
from pytest, where a skip is designated with ans
instead. Images which are (probably) exceedingly different may still cause a test failure.IMAGE_DISTANCE_THRESHOLD
hordelib/utils/distance.py
, namelyCosineSimilarityResultCode
,HistogramDistanceResultCode
,INFERENCE_SIMILARITY_DEFAULTS
andLORA_SIMILARITY_DEFAULTS
test_build_helper.py
removed, replaced with an attempt to import ofbuild_helper.py
tox.ini
for more information.Third party reliant code moved from
preload.py
tocomfy_horde.py
to better isolate code reliant on packaged libraries.Added
unloadModelManagers(cls, codeformer: bool = False, compvis: bool = False ...)
toSharedModelManagers
A tiny bit of cleaning up of MM code