Skip to content

Fixes after merge of #154.#155

Merged
36000 merged 4 commits into
tractometry:mainfrom
arokem:fix_after_154
Jan 20, 2026
Merged

Fixes after merge of #154.#155
36000 merged 4 commits into
tractometry:mainfrom
arokem:fix_after_154

Conversation

@arokem

@arokem arokem commented Jan 20, 2026

Copy link
Copy Markdown
Member
  • Make onnxruntime optional and skip dependent tests if not installed.
  • Install all the requirements on GitHub action to test source dist.

- Make onnxruntime optional and skip dependent tests if not installed.
- Install all the requirements on GitHub action to test source dist.
Copilot AI review requested due to automatic review settings January 20, 2026 18:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes onnxruntime an optional dependency and ensures tests dependent on it are skipped when not installed, while also updating the GitHub Actions workflow to install all optional dependencies when testing the source distribution.

Changes:

  • Made onnxruntime import optional with try/except block and added skip decorators to dependent tests
  • Updated GitHub workflow to install source distribution with all optional dependencies

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
AFQ/tests/test_nn.py Added optional import handling for onnxruntime and skip decorators for tests that require it
.github/workflows/publish-to-test-pypi.yml Modified pip install command to include [all] extras for comprehensive testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AFQ/tests/test_nn.py Outdated
from AFQ.nn.multiaxial import run_multiaxial


@npt.dec.skipif(not has_onnx, reason="onnxruntime is not installed")

Copilot AI Jan 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The decorator npt.dec.skipif is deprecated in NumPy. Since pytest is already used in other test files in this codebase, consider using pytest.mark.skipif instead for consistency and to avoid using deprecated APIs. This would require importing pytest at the top of the file.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Comment thread AFQ/tests/test_nn.py Outdated
npt.assert_(chopped_brain.get_fdata().sum() > 200000)


@npt.dec.skipif(not has_onnx, reason="onnxruntime is not installed")

Copilot AI Jan 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The decorator npt.dec.skipif is deprecated in NumPy. Since pytest is already used in other test files in this codebase, consider using pytest.mark.skipif instead for consistency and to avoid using deprecated APIs. This would require importing pytest at the top of the file.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Comment thread .github/workflows/publish-to-test-pypi.yml Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@36000

36000 commented Jan 20, 2026

Copy link
Copy Markdown
Collaborator

In what circumstance would we not want to run the onnx tests? It is already optional in the main code.

@arokem

arokem commented Jan 20, 2026

Copy link
Copy Markdown
Member Author

test_nn raises an error if onnx is not installed, so a user who installed the package without that optional dependency will get an error from this test if they decide to run the test suite.

@arokem

arokem commented Jan 20, 2026

Copy link
Copy Markdown
Member Author

@36000 : This is ready for a review/merge. We won't really know if it works until it's merged and the workflow is triggered, but 🤞

@36000
36000 merged commit 7b70358 into tractometry:main Jan 20, 2026
9 of 15 checks passed
arokem added a commit to arokem/pyAFQ that referenced this pull request Jan 20, 2026
- Back off installation of sdist with all dependencies.
- Tests should still be fine because onnxruntime now optional.
Copilot AI mentioned this pull request Jan 20, 2026
arokem added a commit that referenced this pull request Jan 20, 2026
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.

3 participants