Skip to content

Commit 6fd75a8

Browse files
committed
Refactor Binder setup and remove requirements.txt
Simplifies Binder environment by delegating Python dependency management to uv in postBuild, removes requirements.txt in favor of single-source dependencies in pyproject.toml, and updates related scripts and environment files accordingly.
1 parent 102025b commit 6fd75a8

File tree

4 files changed

+10
-397
lines changed

4 files changed

+10
-397
lines changed

binder/environment.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
# Binder environment configuration
2-
# This file delegates to uv for dependency management from pyproject.toml
3-
# ensuring single-source-of-truth for dependencies
2+
# Minimal conda environment - uv handles Python packages via postBuild
43

54
name: moderation
65
channels:
76
- conda-forge
87
dependencies:
98
- python=3.12
10-
- uv
119
- pip
12-
- pip:
13-
- -e ../.

binder/postBuild

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
#!/bin/bash
22
# Post-build script for Binder
3-
# Uses uv to install all dependencies from pyproject.toml
3+
# Uses uv to install dependencies from pyproject.toml with locked versions
44

55
set -e
66

7-
# Navigate to repository root
8-
cd "${HOME}"
7+
# Install uv
8+
pip install uv
99

10-
# Install dependencies using uv (which reads from pyproject.toml)
11-
uv sync --all-extras
10+
# Install project with locked dependencies (no dev extras for Binder)
11+
# Using --system since we're in conda's environment, not a venv
12+
uv pip install --system -e .
1213

13-
# Ensure Jupyter extensions are enabled
14-
jupyter labextension list
14+
# Sync jupyter extensions
15+
jupyter labextension list 2>/dev/null || true
1516

1617
echo "Binder environment ready!"

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ dependencies = [
1616
"jupytext>=1.17.2",
1717
"matplotlib>=3.9.4",
1818
"mystmd>=1.7.1",
19-
"numba>=0.59.0", # Ensure Python 3.11 compatibility
19+
"numba>=0.59.0", # Ensure Python 3.11 compatibility
2020
"numpy>=2.0.2",
21-
"ruff>=0.12.8",
2221
"scipy>=1.15.3",
2322
"voila>=0.5.8",
2423
]

0 commit comments

Comments
 (0)