-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpixi.toml
More file actions
157 lines (118 loc) · 4.78 KB
/
Copy pathpixi.toml
File metadata and controls
157 lines (118 loc) · 4.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# pixi.toml - Modern package management for conda + PyPI
# Pixi is the recommended tool for computational biology because it handles
# both conda packages (samtools, bedtools, etc.) and PyPI packages seamlessly.
#
# See: https://pixi.sh/
#
# Quick start:
# pixi install # Create environment and install dependencies
# pixi run test # Run tests
# pixi run lint # Check code style
# pixi shell # Activate environment
[workspace]
name = "hive-protocol"
version = "0.1.0"
description = "The definitive protocol for Python in computational biology"
authors = ["CBG-ETH Zurich <cbg@ethz.ch>"]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-64", "osx-arm64"]
# =============================================================================
# Dependencies
# =============================================================================
[dependencies]
# Python version
python = ">=3.10,<3.13"
# Scientific computing core (from conda-forge for optimized builds)
numpy = ">=1.24"
scipy = ">=1.10"
# Bayesian inference
pymc = ">=5.0"
arviz = ">=0.15"
# Data manipulation
polars = ">=0.20"
# Data validation
pydantic = ">=2.0"
# Visualization
matplotlib = ">=3.7"
seaborn = ">=0.12"
# Development tools (available on conda-forge)
pytest = ">=7.0"
pytest-cov = ">=4.0"
hypothesis = ">=6.0"
ruff = ">=0.8.0"
pre-commit = ">=3.0"
# Documentation
quarto = ">=1.4"
ipykernel = ">=6.0" # Required for Quarto to find Python kernel
jupyter = ">=1.0"
pyyaml = ">=6.0" # Required by Quarto's jupyter integration
# Type checking
mypy = ">=1.0" # Used in CI/pre-commit for stability
pyright = ">=1.1" # Used locally for fast feedback
# =============================================================================
# PyPI-only dependencies
# =============================================================================
[pypi-dependencies]
# Install the package itself in editable mode
hive-protocol = { path = ".", editable = true }
# Snakemake from PyPI (more reliable cross-platform than conda)
snakemake = ">=8.0"
# Docstring coverage checker
interrogate = ">=1.5"
# =============================================================================
# Tasks - Custom commands accessible via `pixi run <task>`
# =============================================================================
[tasks]
# Run tests
test = "pytest tests/ -v"
# Run tests with coverage
test-cov = "pytest tests/ --cov=src/hive_protocol --cov-report=term-missing"
# Run linter
lint = "ruff check src/ tests/"
# Auto-fix lint issues
lint-fix = "ruff check src/ tests/ --fix"
# Format code
format = "ruff format src/ tests/"
# Check formatting without changing files
format-check = "ruff format src/ tests/ --check"
# Type checking - pyright for local dev (fast), mypy for CI (stable)
typecheck = "pyright src/" # Default: fast local feedback
typecheck-strict = "pyright src/ --level strict" # Stricter checking
typecheck-ci = "mypy src/" # Used in CI/pre-commit
# Docstring coverage
docstring-cov = "interrogate src/ -v --fail-under=80"
# Run all quality checks (uses mypy for CI compatibility)
check = { depends-on = ["lint", "format-check", "typecheck-ci", "docstring-cov", "test"] }
# Install pre-commit hooks
hooks = "pre-commit install"
# Run pre-commit on all files
hooks-all = "pre-commit run --all-files"
# Register Jupyter kernel for Quarto
kernel = "python -m ipykernel install --user --name python3 --display-name 'Python 3 (hive-protocol)'"
# Render Quarto notebooks and copy to docs/tutorials
docs = { cmd = "quarto render notebooks/ && rm -rf docs/tutorials && mv notebooks/_site docs/tutorials", depends-on = ["kernel"] }
# Render presentation slides
slides = "quarto render docs/slides.qmd"
# Publish documentation to GitHub Pages
docs-publish = "quarto publish gh-pages docs/ --no-prompt"
# Run Snakemake workflow (dry run)
workflow-dry = "snakemake -n --snakefile workflow/Snakefile"
# Run Snakemake workflow
workflow = "snakemake --cores 4 --snakefile workflow/Snakefile"
# Clean generated files
clean = "rm -rf results/*.parquet docs/*.html .pytest_cache .mypy_cache .ruff_cache"
# =============================================================================
# Activation
# =============================================================================
[activation.env]
# Ensure reproducible PyMC behavior
PYTENSOR_FLAGS = "device=cpu,floatX=float64"
# =============================================================================
# Platform-specific configuration
# =============================================================================
[target.osx-arm64.dependencies]
# ARM Mac specific - use accelerate for faster linear algebra
libblas = { version = "*", build = "*accelerate" }
[target.linux-64.dependencies]
# Linux specific - use OpenBLAS
libblas = { version = "*", build = "*openblas" }