Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and Publish Docker image

on:
push:
branches: ["main", "dev"]
tags: ["v*"]
workflow_dispatch:

permissions:
contents: read
packages: write

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4.0.0

- name: Log in to GitHub Container Registry
uses: docker/login-action@v4.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v6.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=edge,enable=${{ github.ref == 'refs/heads/dev' }}

- name: Build and push Docker image
uses: docker/build-push-action@v7.1.0
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
27 changes: 7 additions & 20 deletions .github/workflows/nextflow-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6.0.2

- uses: actions/setup-java@v5.2.0
with:
Expand All @@ -41,26 +41,13 @@ jobs:
sudo chmod +x /usr/local/bin/nf-test

- name: Lint Nextflow files
# `nextflow lint` does not load Groovy classes from `lib/`, so it
# falsely reports `Helpers` as undefined wherever the workflow calls
# `Helpers.X(...)`. We strip ANSI colour codes from the output, drop
# those known false-positives, and re-derive the exit status.
# Pass -project-dir so that nextflow lint (26.04+) can resolve Groovy
# classes from lib/ (e.g. Helpers). Each workflow lives in its own
# subdirectory, so lint is invoked once per workflow.
run: |
tmp=$(mktemp)
nextflow lint \
workflows/preproc/preproc_rawtiles.nf \
workflows/reconst_3d/soct_3d_reconst.nf \
workflows/reconst_2.5d/soct_2.5d_reconst.nf \
> "$tmp" 2>&1 || true
sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' "$tmp" \
| awk '/`Helpers` is not defined/ { skip = 3; next } skip > 0 { skip--; next } { print }' \
> "$tmp.filt"
cat "$tmp.filt"
if grep -qE '^Error ' "$tmp.filt"; then
echo "::error::nextflow lint reported errors (excluding Helpers false-positives)"
exit 1
fi
echo "Lint passed (Helpers false-positives ignored: lib/ classes are loaded at runtime but not by 'nextflow lint')."
nextflow lint -project-dir workflows/preproc workflows/preproc/preproc_rawtiles.nf
nextflow lint -project-dir workflows/reconst_3d workflows/reconst_3d/soct_3d_reconst.nf
nextflow lint -project-dir workflows/reconst_2.5d workflows/reconst_2.5d/soct_2.5d_reconst.nf

- name: Validate Nextflow configs
run: |
Expand Down
40 changes: 18 additions & 22 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,28 @@ name: Build and Publish Toolkit
on:
push:
tags:
- v1.*
workflow_dispatch:
- "v1.*"
workflow_dispatch:

permissions:
contents: read

jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- uses: actions/checkout@v6.0.2

- name: Install uv
uses: astral-sh/setup-uv@v8.1.0

- name: Set up Python 3.14
run: uv python install 3.14

- name: Build sdist and wheel
run: uv build --sdist --wheel --out-dir dist/

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@v1.14.0
with:
password: ${{ secrets.PYPI_TOKEN }}
46 changes: 26 additions & 20 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,39 @@ name: Python application

on:
push:
branches: [ "main" ]
branches: ["main", "dev"]
pull_request:
branches: [ "main" ]
branches: ["main", "dev"]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python 3.12
run: uv python install 3.12
- name: Install dependencies
run: uv sync
- name: Lint with ruff
run: |
uv run ruff check .
uv run ruff format --check .
- name: Type check with ty
continue-on-error: true
run: uv run ty check
- name: Test with pytest
run: |
uv run pytest
- uses: actions/checkout@v6.0.2

- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
with:
enable-cache: true

- name: Set up Python 3.14
run: uv python install 3.14

- name: Install dependencies
run: uv sync

- name: Lint with ruff
run: |
uv run ruff check .
uv run ruff format --check .

- name: Type check with ty
continue-on-error: true
run: uv run ty check

- name: Test with pytest
run: uv run pytest
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ cython_debug/
.nextflow/
*.nextflow.log*

# nf-test
.nf-test/
.nf-test.log

# Standalone tools (separate git repos)
tools/
workflows/work/
Expand Down
30 changes: 0 additions & 30 deletions .pep8speaks.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: 2
build:
os: ubuntu-24.04
tools:
python: "3.12"
python: "3.14"
jobs:
create_environment:
- asdf plugin add uv
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12
FROM python:3.14

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

Expand All @@ -19,5 +19,5 @@ RUN apt-get update && apt-get install -y \
# Install with uv
COPY linumpy ./linumpy
COPY scripts ./scripts
COPY pyproject.toml uv.lock README.md .python-version ./
COPY pyproject.toml uv.lock README.md ./
RUN uv sync --frozen --no-dev
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Installation
*Although a version of the library is available on PyPI, it has not been updated in a while. We highly discourage its use.*

The library is tested for python 3.12. To install the library, clone the repository, change directory to the repository root and then install it with the command below:
The library is tested for python 3.14. To install the library, clone the repository, change directory to the repository root and then install it with the command below:
```
pip install .
```
Expand Down
2 changes: 1 addition & 1 deletion docs/NEXTFLOW_WORKFLOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ rm -rf work/

```bash
# Pull container manually
apptainer pull linumpy.sif docker://ghcr.io/linum/linumpy:latest
apptainer pull linumpy.sif docker://ghcr.io/linum-uqam/linumpy:latest

# Run with explicit container
nextflow run workflow.nf -with-apptainer linumpy.sif
Expand Down
2 changes: 0 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html
"""Sphinx configuration for the linumpy documentation."""

from __future__ import annotations

import sys
from datetime import datetime
from pathlib import Path
Expand Down
3 changes: 1 addition & 2 deletions linumpy/cli/args.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Common argument-parsing helpers for linumpy CLI scripts."""

import argparse
import multiprocessing
import os
import shutil
from pathlib import Path
Expand All @@ -19,7 +18,7 @@ def get_available_cpus() -> int:
-------
int: Number of available CPUs
"""
total_cpus = multiprocessing.cpu_count()
total_cpus = os.process_cpu_count() or os.cpu_count() or 1

# Check for explicit max CPUs limit
max_cpus = os.environ.get("LINUMPY_MAX_CPUS")
Expand Down
Loading