Skip to content

Fix bisect_model pytest dependency#2722

Open
kiwigitops wants to merge 1 commit into
apple:mainfrom
kiwigitops:fix-bisect-model-pytest-import
Open

Fix bisect_model pytest dependency#2722
kiwigitops wants to merge 1 commit into
apple:mainfrom
kiwigitops:fix-bisect-model-pytest-import

Conversation

@kiwigitops

Copy link
Copy Markdown
Contributor

Summary

  • stop bisect_model output verification from importing coremltools.converters.mil.testing_utils
  • keep the small random-input and PSNR helpers in models/utils.py, so correctness checking does not require pytest
  • add a regression that exercises the verification path while blocking the test utility import

Fixes #2419

Tests

  • python -m pytest coremltools/test/ml_program/test_utils.py::TestBisectModel::test_verify_output_correctness_does_not_import_testing_utils -q
  • python -m compileall -q coremltools/models/utils.py coremltools/test/ml_program/test_utils.py
  • git diff --check origin/main..HEAD

@kiwigitops

Copy link
Copy Markdown
Contributor Author

Quick follow-up on this. The bisect_model verification path still imports cleanly without pytest-only utilities after this change. Happy to adjust the regression coverage if needed.

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.

ct.models.utils.bisect_model requires pytest to be installed

1 participant