From 08438a85dd85260ac589f8e4aabfb0e018958ff0 Mon Sep 17 00:00:00 2001 From: Ariel Rokem Date: Fri, 11 Sep 2026 11:18:20 -0400 Subject: [PATCH 1/3] BF: Resolve path to tools correctly. 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. --- pyproject.toml | 2 +- trx/tests/test_update_switcher.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fcf5e50..aff72b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ dependencies = [ [project.optional-dependencies] utils = [ - "dipy", + "dipy >= 1.12", "fury >= 0.10.0, < 2.0.0" ] dev = [ diff --git a/trx/tests/test_update_switcher.py b/trx/tests/test_update_switcher.py index f45378d..0cb46b4 100644 --- a/trx/tests/test_update_switcher.py +++ b/trx/tests/test_update_switcher.py @@ -8,7 +8,7 @@ import pytest -TOOLS_DIR = Path(__file__).resolve().parents[2] / "tools" +TOOLS_DIR = Path(__file__).resolve().parent.parent.parent / "tools" SCRIPT = TOOLS_DIR / "update_switcher.py" From 40d28ae84d3184b787de67d451d726228b7d8ce0 Mon Sep 17 00:00:00 2001 From: Ariel Rokem Date: Wed, 16 Sep 2026 11:29:11 -0400 Subject: [PATCH 2/3] Move the tools folder, with the update_switcher into trx. This is so that it can be installed and tested properly. Also updates docbuild workflow appropriately. --- .github/workflows/docbuild.yml | 4 ++-- trx/tests/test_update_switcher.py | 2 +- {tools => trx/tools}/update_switcher.py | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename {tools => trx/tools}/update_switcher.py (100%) diff --git a/.github/workflows/docbuild.yml b/.github/workflows/docbuild.yml index 43a0825..bc8c533 100644 --- a/.github/workflows/docbuild.yml +++ b/.github/workflows/docbuild.yml @@ -85,7 +85,7 @@ jobs: - name: Update switcher.json with new version id: switcher run: | - python tools/update_switcher.py gh-pages-out/switcher.json \ + python trx/tools/update_switcher.py gh-pages-out/switcher.json \ --version "${{ steps.get_version.outputs.VERSION }}" \ --github-output "$GITHUB_OUTPUT" - name: Deploy all release docs in a single push @@ -160,7 +160,7 @@ jobs: esac done echo "Rebuilding switcher from:$args" - python tools/update_switcher.py gh-pages-out/switcher.json --rebuild $args + python trx/tools/update_switcher.py gh-pages-out/switcher.json --rebuild $args - name: Commit and push switcher.json run: | cd gh-pages-out diff --git a/trx/tests/test_update_switcher.py b/trx/tests/test_update_switcher.py index 0cb46b4..972694e 100644 --- a/trx/tests/test_update_switcher.py +++ b/trx/tests/test_update_switcher.py @@ -8,7 +8,7 @@ import pytest -TOOLS_DIR = Path(__file__).resolve().parent.parent.parent / "tools" +TOOLS_DIR = Path(__file__).resolve().parent.parent / "tools" SCRIPT = TOOLS_DIR / "update_switcher.py" diff --git a/tools/update_switcher.py b/trx/tools/update_switcher.py similarity index 100% rename from tools/update_switcher.py rename to trx/tools/update_switcher.py From 5307cc675119b95653face57a39ea84e5d8f6c9c Mon Sep 17 00:00:00 2001 From: Ariel Rokem Date: Thu, 17 Sep 2026 16:13:01 -0400 Subject: [PATCH 3/3] Do not document tools and include as package data. --- docs/source/conf.py | 2 +- pyproject.toml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 7589615..417dc36 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -137,7 +137,7 @@ autoapi_type = 'python' autoapi_dirs = ['../../trx'] -autoapi_ignore = ['*test*', '*version*'] +autoapi_ignore = ['*test*', '*version*', '*tools*'] def _validate_reference_urls(urls, timeout=5): diff --git a/pyproject.toml b/pyproject.toml index aff72b9..df1b89f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,6 +92,10 @@ trx_info = "trx.cli:info_cmd" packages = ["trx"] include-package-data = true +[tool.setuptools.package-data] +trx = ["tools/*.py"] + + [tool.setuptools_scm] write_to = "trx/_version.py" fallback_version = "0.0"