python-trx

LOW
maintainer tobac 0 votes scanned 2026-09-26 09:14:41.464653
View on AUR
Why flagged

The package downloads test data from a non-whitelisted but project-owned GitHub repository; the data is not executable and used solely for testing, posing minimal risk.

Triggered rules

Low Few votes, recently uploaded zero_votes_recent

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

Low AI review llm_review

An AI model (qwen/qwen3-235b-a22b-2507) reviewed this and agrees it is LOW (confidence 95%): The package downloads test data from a non-whitelisted but project-owned GitHub repository; the data is not executable and used solely for testing, posing minimal risk.

PKGBUILD

1# Maintainer: Tobias Bachmann <tobachmann@gmx.de>
2
3pkgname=python-trx
4_name=trx_python
5pkgver=0.6
6pkgrel=1
7_testdata=v0.1.0
8pkgdesc="A community-oriented file format for tractography"
9arch=('any')
10url="https://github.com/tee-ar-ex/trx-python"
11license=('BSD-2-Clause')
12depends=(
13 'python'
14 'python-deepdiff'
15 'python-nibabel'
16 'python-numpy'
17 'python-typer'
18)
19makedepends=(
20 'python-build'
21 'python-installer'
22 'python-setuptools'
23 'python-setuptools-scm'
24 'python-wheel'
25)
26checkdepends=(
27 'python-psutil'
28 'python-pytest'
29 'python-pytest-console-scripts'
30)
31optdepends=(
32 'python-dipy: extra utilities and tractogram tools'
33 'python-fury: overlap visualization (trx_visualize_overlap)'
34)
35_testurl="https://github.com/tee-ar-ex/trx-test-data/releases/download/$_testdata"
36source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz"
37 "trx-nibabel-test-helpers.py"
38 "trx-test-data-$_testdata-DSI.zip::$_testurl/DSI.zip"
39 "trx-test-data-$_testdata-gold_standard.zip::$_testurl/gold_standard.zip"
40 "trx-test-data-$_testdata-memmap_test_data.zip::$_testurl/memmap_test_data.zip"
41 "trx-test-data-$_testdata-trx_from_scratch.zip::$_testurl/trx_from_scratch.zip"
42 "trx-nibabel-test-helpers.py")
43noextract=("trx-test-data-$_testdata-DSI.zip"
44 "trx-test-data-$_testdata-gold_standard.zip"
45 "trx-test-data-$_testdata-memmap_test_data.zip"
46 "trx-test-data-$_testdata-trx_from_scratch.zip")
47sha256sums=('434d53ca9ba347680ff334124c5882668f322660c75aba480e88bdbba8de349f'
48 '6ca47341cf643becf6b678dc272781ee8285c85f7a922c807171e25877890b67'
49 '1b09ce8b4b47b2600336c558fdba7051218296e8440e737364f2c4b8ebae666c'
50 '35a0b633560cc2b0d8ecda885aa72d06385499e0cd1ca11a956b0904c3358f01'
51 '98ba89d7a9a7baa2d37956a0a591dce9bb4581bd01296ad5a596706ee90a52ef'
52 'f98ab6da6a6065527fde4b0b6aa40f07583e925d952182e9bbd0febd55c0f6b2'
53 '6ca47341cf643becf6b678dc272781ee8285c85f7a922c807171e25877890b67')
54
55build() {
56 cd "$_name-$pkgver"
57 python -m build --wheel --no-isolation
58}
59
60check() {
61 cd "$_name-$pkgver"
62 local _site=$(python -c "import site; print(site.getsitepackages()[0])")
63 rm -rf test_dir
64 python -m installer --destdir=test_dir dist/*.whl
65
66 # Pre-seed the test data; upstream's fetcher skips downloads for existing files
67 export TRX_HOME="$srcdir/trx-home"
68 mkdir -p "$TRX_HOME"
69 local _f
70 for _f in DSI gold_standard memmap_test_data trx_from_scratch; do
71 ln -sf "$srcdir/trx-test-data-$_testdata-$_f.zip" "$TRX_HOME/$_f.zip"
72 done
73
74 # test_memmap.py imports a helper from nibabel's test suite, which Arch's
75 # python-nibabel doesn't ship; point it at a local copy instead
76 mkdir -p "$srcdir/test-helpers"
77 ln -sf "$srcdir/trx-nibabel-test-helpers.py" "$srcdir/test-helpers/nibabel_test_helpers.py"
78 sed -i 's/^from nibabel\.streamlines\.tests\.test_tractogram import make_dummy_streamline$/from nibabel_test_helpers import make_dummy_streamline/' \
79 "test_dir$_site/trx/tests/test_memmap.py"
80 grep -q '^from nibabel_test_helpers import' "test_dir$_site/trx/tests/test_memmap.py"
81
82 # CLI tests call the installed console scripts
83 export PATH="$PWD/test_dir/usr/bin:$PATH"
84 export PYTHONPATH="$PWD/test_dir$_site:$srcdir/test-helpers"
85 cd "test_dir$_site"
86 python -m pytest -p no:cacheprovider trx/tests
87}
88
89package() {
90 cd "$_name-$pkgver"
91 python -m installer --destdir="$pkgdir" dist/*.whl
92 install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
93}
94

Scan history

Scanned at (UTC)SeverityRules
2026-09-26 09:14:41 Low 2

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion