Skip to content
Draft
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
5 changes: 4 additions & 1 deletion .github/workflows/check-empty-cells.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ jobs:
- name: 🔄 Checkout code
uses: actions/checkout@v4

- name: 🚀 Install uv
uses: astral-sh/setup-uv@v4

- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: 🔍 Check for empty cells
run: |
python scripts/check_empty_cells.py
make check_empty

- name: 📊 Report results
if: failure()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: 🛠️ Export notebooks
run: |
python scripts/build.py
make build

- name: 📤 Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,12 @@ __marimo__

# Generated site content
_site/

# Editors
*~

# Temporary build files
tmp/
example.db
example.db.wal
log_data_filtered*.*
3 changes: 3 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ extend-ignore-re = [

# Words to explicitly accept
[default.extend-words]
bimap = "bimap"
pn = "pn"
setp = "setp"
Plas = "Plas"

# You can also exclude specific files or directories if needed
# [files]
Expand Down
116 changes: 104 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,116 @@
# Default target.
ROOT := .
SITE := _site
TMP := ./tmp
LESSON_DATA := ${TMP}/lessons.json
TEMPLATES := $(wildcard templates/*.html)

NOTEBOOK_INDEX := $(wildcard */index.md)
NOTEBOOK_DIR := $(patsubst %/index.md,%,${NOTEBOOK_INDEX})
NOTEBOOK_SRC := $(foreach dir,$(NOTEBOOK_DIR),$(wildcard $(dir)/??_*.py))
NOTEBOOK_OUT := $(patsubst %.py,${SITE}/%.html,$(NOTEBOOK_SRC))

DATABASES := \
sql/public/lab.db \
sql/public/penguins.db \
sql/public/survey.db

MARIMO := uv run marimo
PYTHON := uv run python

# Default target
all : commands

## commands : show all commands.
commands :
## commands : show all commands
commands:
@grep -h -E '^##' ${MAKEFILE_LIST} | sed -e 's/## //g' | column -t -s ':'

## install: install minimal required packages into current environment.
## install: install required packages
install:
uv pip install marimo jinja2 markdown
uv pip install -r requirements.txt

## check: run all simple checks
check:
-@make check_empty
-@make check_titles
-@make check_typos
-@make check_packages

## build: build entire site.
build:
rm -rf _site
uv run scripts/build.py
## check_exec: run notebooks to check for runtime errors
check_exec:
@if [ -z "$(NOTEBOOKS)" ]; then \
bash bin/run_notebooks.sh $(NOTEBOOK_SRC); \
else \
bash bin/run_notebooks.sh $(NOTEBOOKS); \
fi

## serve: run local web server without rebuilding.
## build: build website
build: ${LESSON_DATA} ${NOTEBOOK_OUT} ${TEMPLATES}
${PYTHON} bin/build.py --root ${ROOT} --output ${SITE} --data ${LESSON_DATA}

## links: check links locally (while 'make serve')
links:
linkchecker -F text http://localhost:8000

## serve: run local web server without rebuilding
serve:
uv run python -m http.server --directory _site
${PYTHON} -m http.server --directory ${SITE}

## databases: rebuild datasets for SQL lessons
databases: ${DATABASES}

## clean: clean up stray files.
## ---: ---

## clean: clean up stray files
clean:
@find . -name '*~' -exec rm {} +
@find . -name '.DS_Store' -exec rm {} +
@rm -rf ${TMP}
@rm -f log_data_filtered*.*

## check_empty: check for empty cells
check_empty:
@${PYTHON} bin/check_empty_cells.py

## check_titles: check for missing titles in notebooks
check_titles:
@${PYTHON} bin/check_missing_titles.py

## check_packages: check for inconsistent package versions across notebooks
check_packages:
@if [ -z "$(NOTEBOOKS)" ]; then \
${PYTHON} bin/check_notebook_packages.py $(NOTEBOOK_SRC); \
else \
${PYTHON} bin/check_notebook_packages.py $(NOTEBOOKS); \
fi

## check_typos: check for typos
check_typos:
@typos ${TEMPLATES} ${NOTEBOOK_INDEX} ${NOTEBOOK_SRC}

## extract: extract lesson data
extract: ${LESSON_DATA}

#
# subsidiary targets
#

tmp/lessons.json: $(NOTEBOOK_INDEX)
${PYTHON} bin/extract.py --root ${ROOT} --data ${LESSON_DATA}

${SITE}/%.html: %.py
${MARIMO} export html-wasm --force --mode edit $< -o $@ --sandbox

sql/public/lab.db: bin/create_sql_lab.sql
@rm -f $@
@mkdir -p sql/public
sqlite3 $@ < $<

sql/public/penguins.db: bin/create_sql_penguins.py data/penguins.csv
@rm -f $@
@mkdir -p sql/public
${PYTHON} $< data/penguins.csv $@

sql/public/survey.db: bin/create_sql_survey.py
@rm -f $@
@mkdir -p sql/public
${PYTHON} $< $@ 192837
5 changes: 0 additions & 5 deletions _server/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
---
title: Readme
marimo-version: 0.18.4
---

# marimo learn server

This folder contains server code for hosting marimo apps.
Expand Down
6 changes: 3 additions & 3 deletions _server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
# "starlette",
# "python-dotenv",
# "pydantic",
# "duckdb==1.3.2",
# "altair==5.5.0",
# "duckdb==1.4.4",
# "altair==6.0.0",
# "beautifulsoup4==4.13.3",
# "httpx==0.28.1",
# "marimo",
# "nest-asyncio==1.6.0",
# "numba==0.61.0",
# "numpy==2.1.3",
# "numpy==2.4.3",
# "polars==1.24.0",
# ]
# ///
Expand Down
Loading
Loading