Skip to content

Commit ddbfe6e

Browse files
authored
Switch to using uv to manage the environment (#67)
1 parent 956956d commit ddbfe6e

135 files changed

Lines changed: 214566 additions & 217408 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ updates:
1111
assignees: ["tsalo"]
1212
schedule:
1313
interval: "weekly"
14-
- package-ecosystem: pip
14+
- package-ecosystem: "uv"
1515
directory: "/"
1616
labels: ["maintenance", "ignore-for-release"]
17+
assignees: ["tsalo"]
1718
schedule:
1819
interval: weekly

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ venv/
115115
ENV/
116116
env.bak/
117117
venv.bak/
118+
meda/
118119

119120
# Spyder project settings
120121
.spyderproject

Makefile

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,41 @@
1-
.PHONY: help book clean serve sync-docs site-publish
1+
# Name of the uv-managed project environment directory.
2+
# `uv` honors UV_PROJECT_ENVIRONMENT to place the venv somewhere other than .venv.
3+
export UV_PROJECT_ENVIRONMENT := meda
4+
5+
# Reproducible image outputs: matplotlib honors SOURCE_DATE_EPOCH and will stamp
6+
# PNGs with a fixed timestamp instead of "now", so identical plots produce
7+
# identical bytes (and identical content-hashed filenames in _images/).
8+
# 1577836800 == 2020-01-01T00:00:00Z
9+
export SOURCE_DATE_EPOCH := 1577836800
10+
11+
.PHONY: help check-env book clean serve sync-docs site-publish install runall build site
212

313
help:
414
@echo "Please use 'make <target>' where <target> is one of:"
5-
@echo " install to install the necessary dependencies for jupyter-book to build"
6-
@echo " book to convert the content/ folder into Jekyll markdown in _build/"
15+
@echo " install to sync the 'meda' environment from uv.lock"
16+
@echo " check-env to verify the 'meda' environment matches uv.lock"
17+
@echo " book to activate 'meda' and build the Jupyter Book into _build/"
718
@echo " clean to clean out site build files"
819
@echo " runall to run all notebooks in-place, capturing outputs with the notebook"
920
@echo " serve to serve the repository locally with Jekyll"
1021
@echo " build to build the site HTML and store in _site/"
11-
@echo " site to build the site HTML, store in _site/, and serve with Jekyll"
22+
@echo " site to build the site HTML, store in _site/, and serve with Jekyll"
1223
@echo " sync-docs to copy _build/html into docs/ for GitHub Pages"
1324
@echo " site-publish to build the book and sync docs/ (book + sync-docs)"
1425

1526

1627
install:
17-
jupyter-book install ./
28+
uv sync --locked
29+
30+
# Verify that the local 'meda' environment is up-to-date with uv.lock.
31+
# `uv sync --locked --check` exits non-zero if the environment would change.
32+
check-env:
33+
@echo "Checking that '$(UV_PROJECT_ENVIRONMENT)' matches uv.lock..."
34+
uv sync --locked --check
1835

19-
book:
20-
jupyter-book build ./
36+
# Activate the 'meda' environment (via `uv run`) and build the book.
37+
book: check-env
38+
uv run --locked jupyter-book build ./
2139

2240
sync-docs:
2341
python scripts/sync_docs.py
@@ -33,8 +51,8 @@ clean:
3351
serve:
3452
bundle exec guard
3553

36-
build:
37-
jupyter-book build ./ --overwrite
54+
build: check-env
55+
uv run --locked jupyter-book build ./ --overwrite
3856

3957
site: build
4058
bundle exec jekyll build

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ title : "Multi-Echo fMRI Data Analysis" # The title of th
99
author : "The tedana community" # The author of the book
1010
copyright : "2021" # Copyright year to be placed in the footer
1111
logo : "logo.png" # A path to the book logo
12-
exclude_patterns : ["README.md", "content/*.py", "docs/**", "data/ds*/logs/*.md", "data/ds*/*.md", "content/ds*/logs/*.md", "notebooks/README_notebooks.md", "notebooks/*.ipynb"]
12+
exclude_patterns : ["README.md", "content/*.py", "docs/**", "meda/**", ".venv/**", "data/ds*/logs/*.md", "data/ds*/*.md", "content/ds*/logs/*.md", "notebooks/README_notebooks.md", "notebooks/*.ipynb"]
1313

1414
#######################################################################################
1515
# Execution settings

content/Acquiring_Multi_Echo_Data.md

Lines changed: 10 additions & 5 deletions

content/fMRI_Sequences.md

Lines changed: 1 addition & 1 deletion

content/plot_approach_figures.md

Lines changed: 0 additions & 1 deletion
64.2 KB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)