Skip to content

BF: Resolve path to tools correctly. - #147

Merged
arokem merged 3 commits into
tee-ar-ex:mainfrom
arokem:fix/test-update-switcher
Sep 17, 2026
Merged

arokem merged 3 commits into
tee-ar-ex:mainfrom
arokem:fix/test-update-switcher

Conversation

@arokem

@arokem arokem commented Sep 11, 2026

Copy link
Copy Markdown
Member

Follow up from #144

This is causing failures only when testing sdist, because it can only be tested in the context of an installation.

Here the following code:

TOOLS_DIR = Path(__file__).resolve().parents[2] / "tools"

resolved incorrectly, because the test file is located at trx/tests/test_update_switcher.py, not tests/test_update_switcher.py So, going up 2 parents from that location would be wrong and raises that error in the CI.

Also, pins DIPY dependency, which needs to be >=1.12, based on running the tests locally with 1.11, which did not work.

Follow up from tee-ar-ex#144

This is causing failures only when testing sdist, because it can only
be tested in the context of an installation.

Here the following code:

```
TOOLS_DIR = Path(__file__).resolve().parents[2] / "tools"
```

resolved incorrectly, because the test file is located at
`trx/tests/test_update_switcher.py`, not `tests/test_update_switcher.py`
So, going up 2 parents from that location would be wrong and raises
that error in the CI.
@codecov

codecov Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.40%. Comparing base (26adbf2) to head (5307cc6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #147      +/-   ##
==========================================
- Coverage   86.86%   86.40%   -0.47%     
==========================================
  Files          14       15       +1     
  Lines        2970     3031      +61     
==========================================
+ Hits         2580     2619      +39     
- Misses        390      412      +22     
Flag Coverage Δ
unittests 86.40% <100.00%> (-0.47%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@arokem

arokem commented Sep 11, 2026

Copy link
Copy Markdown
Member Author

@skoudoro : if you get a chance to take a look and give this a 👍, I'd appreciate it

@skoudoro skoudoro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi @arokem,

DIPY pin is ok, but the other change still fails for me

Comment thread trx/tests/test_update_switcher.py Outdated
import pytest

TOOLS_DIR = Path(__file__).resolve().parents[2] / "tools"
TOOLS_DIR = Path(__file__).resolve().parent.parent.parent / "tools"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Did he work for you ? Despite the change, it is still failing for me

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.

Works now with the recent commit

@arokem

arokem commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

I think I see what is happening, but to be honest, I am not even sure why we are testing this functionality that is not directly related to TRX in the context of this library. I am inclined to remove the test altogether.

@arokem

arokem commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

Barring that, I think that we'd need to move the "tools" folder into the trx module, so that it gets properly installed.

This is so that it can be installed and tested properly.

Also updates docbuild workflow appropriately.
@arokem

arokem commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

Last commit 40d28ae implements the latter approach by moving tools into trx/tools and updating workflow accordingly

@skoudoro skoudoro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the update @arokem,

Few comments below but looks good otherwise

Comment thread pyproject.toml
utils = [
"dipy",
"dipy >= 1.12",
"fury >= 0.10.0, < 2.0.0"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can you add

[tool.setuptools.package-data]
trx = ["tools/*.py"]

and also 'tools' to autoapi_ignore. to avoid to see this in the API.

Also, to remove from codecov ( trx/tools/*). because it decrease it for no reason

@arokem

arokem commented Sep 17, 2026

Copy link
Copy Markdown
Member Author

Also, to remove from codecov ( trx/tools/*). because it decrease it for no reason

Not sure that I follow the logic here. This is being tested, so we want to at least make sure that coverage doesn't go down over time, no?

@skoudoro

Copy link
Copy Markdown
Collaborator

Not sure that I follow the logic here. This is being teste

Yes sorry, ignore, not sure why I miss those tests when looking at the files.

so all good

@arokem
arokem merged commit 23d13b2 into tee-ar-ex:main Sep 17, 2026
19 of 20 checks passed
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.

2 participants