Skip to content

Commit 6c32a72

Browse files
committed
Merge branch 'main' into 22-consistent-test-struct
2 parents b0c56f9 + 071adc1 commit 6c32a72

12 files changed

Lines changed: 503 additions & 121 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
python-version: ["3.10", "3.12", "3.13"]
16-
15+
python-version: ["3.11", "3.12", "3.13"]
1716
steps:
1817
- uses: actions/checkout@v4
1918

@@ -38,7 +37,6 @@ jobs:
3837
# Run tests in the venv
3938
- name: Run tests
4039
env:
41-
TMEQ_RUN_CURVELETS: "0"
4240
QT_QPA_PLATFORM: "offscreen"
4341
run: |
4442
source venv/bin/activate

.github/workflows/manual-test.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Manual Testing Stub
2+
3+
# This action allows manual testing of other actions from branches, without
4+
# requiring them to be on main themselves.
5+
6+
on:
7+
# Enable manual execution from GitHub UI
8+
workflow_dispatch:
9+
10+
jobs:
11+
test-run:
12+
# Create this file on your branch as the action to test
13+
uses: ./.github/workflows/test-action.yml
14+
secrets: inherit

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*.pydevproject
66
.project
77
.metadata
8-
bin/
98
tmp/
109
*.tmp
1110
*.bak
@@ -100,7 +99,6 @@ DocProject/Help/html
10099
publish
101100

102101
# Others
103-
[Bb]in
104102
[Oo]bj
105103
sql
106104
TestResults
@@ -136,14 +134,16 @@ Desktop.ini
136134

137135
*.py[co]
138136

137+
# uv
138+
uv.lock
139+
139140
# Packages
140141
*.egg
141142
*.egg-info
142143
dist
143144
build
144145
eggs
145146
parts
146-
bin
147147
var
148148
sdist
149149
develop-eggs

Makefile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Makefile for tme-quant
2+
# Convenience commands for common tasks
3+
4+
.PHONY: help setup test check clean
5+
6+
help:
7+
@echo "tme-quant Makefile Commands"
8+
@echo ""
9+
@echo "Setup & Installation:"
10+
@echo " make setup - Automated installation with curvelops (uses bin/install.sh)"
11+
@echo ""
12+
@echo "Development:"
13+
@echo " make test - Run test suite"
14+
@echo " make check - Run linting"
15+
@echo " make clean - Clean build artifacts"
16+
@echo ""
17+
18+
setup:
19+
@echo "Running automated installation..."
20+
bash bin/install.sh
21+
22+
test:
23+
uv run pytest -v
24+
25+
check:
26+
uv run ruff check .
27+
28+
clean:
29+
rm -rf build/ dist/ *.egg-info
30+
find . -type d -name __pycache__ -exec rm -r {} +
31+
find . -type f -name "*.pyc" -delete
32+
rm -rf .pytest_cache .coverage htmlcov

README.md

Lines changed: 58 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -14,72 +14,47 @@ This project depends on code that cannot be redistributed here:
1414

1515
Base requirements:
1616
- macOS, Linux, or Windows (see notes below)
17-
- Conda (recommended) or Python 3.10–3.13
18-
- For napari: a Qt binding (PyQt or PySide)
17+
- Python 3.11+
18+
- [uv](https://docs.astral.sh/uv/) (recommended) or pip
19+
- napari uses PyQt6 (included in dependencies)
1920

2021
### Quick start (without curvelets)
21-
Install the package and the napari GUI. This path avoids the native curvelet build.
2222

2323
```bash
24-
conda create -y -n napari-env -c conda-forge python=3.11 pip
25-
conda activate napari-env
26-
27-
# project install (editable)
28-
pip install -e .
29-
30-
# napari + Qt
31-
conda install -y -c conda-forge napari pyqt qtpy
24+
uv sync
25+
uv run napari
3226
```
3327

3428
### Optional: curvelet backend (curvelops)
35-
To enable curvelet-powered features and tests you must build and install FFTW 2.1.5 and CurveLab, then install `curvelops`.
3629

37-
macOS/Linux outline:
30+
To enable curvelet-powered features and tests you must build FFTW 2.1.5 and CurveLab, then install with curvelops. Use the automated script:
31+
32+
**Prerequisites:** Clone this repo, install [uv](https://docs.astral.sh/uv/), and download CurveLab to `../utils` (see [doc/INSTALL.md](doc/INSTALL.md)).
33+
34+
macOS/Linux:
3835
```bash
39-
# 1) Build FFTW 2.1.5 (C only)
40-
curl -L -O http://www.fftw.org/fftw-2.1.5.tar.gz
41-
tar xzf fftw-2.1.5.tar.gz
42-
cd fftw-2.1.5
43-
# If configure fails on macOS due to outdated config.{sub,guess}, update them from your system
44-
./configure --prefix="$HOME/opt/fftw-2.1.5" --disable-fortran
45-
make -j$(sysctl -n hw.logicalcpu 2>/dev/null || nproc)
46-
make install
47-
export FFTW="$HOME/opt/fftw-2.1.5"
48-
49-
# 2) Build CurveLab 2.1.x
50-
export FDCT="/path/to/CurveLab-2.1.x"
51-
cd "$FDCT/fdct_wrapping_cpp/src" && make
52-
cd "$FDCT/fdct/src" && make
53-
cd "$FDCT/fdct3d/src" && make
54-
55-
# 3) Install build tooling and curvelops
56-
conda activate napari-env
57-
python -m pip install -U pip
58-
pip install pybind11 scikit-build-core cmake ninja
59-
export FFTW="$HOME/opt/fftw-2.1.5"
60-
export FDCT="/path/to/CurveLab-2.1.x"
61-
pip install -v "curvelops @ git+https://github.com/PyLops/curvelops@0.23"
36+
bash bin/install.sh
37+
# or: make setup
6238
```
6339

6440
Windows options:
6541
- Recommended: use WSL2 (Ubuntu). Follow the macOS/Linux steps inside WSL.
66-
- Native Windows: use MSYS2 (for `gcc`, `make`) or Visual Studio toolchain; build FFTW 2.1.5 and CurveLab from source, set `FFTW` and `FDCT` env vars to their install roots, then install `curvelops` as above. Supervisors can validate these steps on a Windows host.
42+
- Native Windows: use MSYS2 (for `gcc`, `make`) or Visual Studio toolchain; build FFTW 2.1.5 and CurveLab from source, set `FFTW` and `FDCT` env vars to their install roots, then use `uv` commands as above.
43+
44+
### Development
45+
46+
See [doc/DEVELOPMENT.md](doc/DEVELOPMENT.md) for plugin setup and troubleshooting. Running tests:
6747

68-
### Development: running the tests
6948
- Headless (no GUI): set Qt to offscreen
7049
- macOS/Linux: `export QT_QPA_PLATFORM=offscreen`
7150
- Windows/PowerShell: `$env:QT_QPA_PLATFORM = 'offscreen'`
7251

7352
- Core tests (no curvelets):
7453
```bash
75-
pytest -q
54+
make test
7655
```
7756

78-
- Full tests with curvelets (after installing `curvelops`):
79-
```bash
80-
export TMEQ_RUN_CURVELETS=1
81-
pytest -q
82-
```
57+
- Full tests with curvelets (after installing `curvelops`): `make test` — curvelet tests run automatically when curvelops is available; otherwise skipped.
8358

8459
Notes:
8560
- The napari test is an import-only smoke test (no `Viewer` is created); it runs headless.
@@ -93,10 +68,47 @@ Testing policy:
9368
### Continuous integration
9469
- CI installs the package without `curvelops` to avoid building FFTW/CurveLab on runners.
9570
- CI environment:
96-
- `TMEQ_RUN_CURVELETS=0` (curvelet tests skipped)
71+
- Curvelet tests skipped (curvelops not installed on CI)
9772
- `QT_QPA_PLATFORM=offscreen` (headless napari import)
9873

74+
### Working with secrets in GitHub Actions
75+
This project uses GitHub Actions secrets for tasks that require authentication or access to private resources. Secrets can be configured in the [Settings tab of the repostiory](https://github.com/uw-loci/tme-quant/settings/secrets/actions). For more information about secrets, see:
76+
- [Secrets as a concept](https://docs.github.com/en/actions/concepts/security/secrets)
77+
- [Secrets in actions](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions).
78+
79+
#### Manual testing workflow
80+
The `manual-test` workflow allows developers to manually trigger workflows from the GitHub UI without committing changes to `main`. This is useful for testing workflows that require secrets on topic branches.
81+
82+
**How to use it:**
83+
84+
1. Create or edit `.github/workflows/test-action.yml` to define your workflow's structure and declare which secrets it needs via the `secrets:` input in `workflow_call`:
85+
```yaml
86+
on:
87+
workflow_call:
88+
secrets:
89+
MY_SECRET_NAME:
90+
ANOTHER_SECRET:
91+
92+
jobs:
93+
my-job:
94+
runs-on: ubuntu-latest
95+
steps:
96+
- name: Use a secret
97+
run: echo "Secret is ${{ secrets.MY_SECRET_NAME }}"
98+
```
99+
100+
2. The `manual-test` workflow (`.github/workflows/manual-test.yml`) will call `test-action.yml` and pass repository secrets to it via `secrets: inherit`.
101+
102+
3. To trigger the workflow:
103+
- Push your branch with the updated `test-action.yml` to GitHub.
104+
- Go to the **Actions** tab in the repository and select the **[Manual Testing Stub](https://github.com/uwloci/tme-quant/actions/workflows/manual-test.yml)** workflow.
105+
- Click **Run workflow** and select your branch.
106+
- The workflow will execute with access to all secrets configured for the repository.
107+
108+
**NOTE**
109+
- Never hardcode secrets or access tokens in workflow files; always use the `secrets:` context.
110+
99111
### Troubleshooting
100-
- Qt error ("No Qt bindings could be found"): install `pyqt` (or `pyside2`) from conda-forge.
112+
- Qt error ("No Qt bindings could be found"): ensure `uv sync` completed; pyproject includes PyQt6.
101113
- Segfault on Viewer creation: avoid creating a `napari.Viewer()` in tests; we only import napari and run offscreen.
102114
- curvelops build errors: ensure `FFTW` and `FDCT` point to your install roots and the 2D/3D libraries were built.

0 commit comments

Comments
 (0)