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
1 change: 1 addition & 0 deletions .ai-instructions
Submodule .ai-instructions added at 68dc3f
48 changes: 48 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: main
# Automatically cancel a previous run.
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
push:
branches: [main]
pull_request:
branches: ['*']
jobs:
run-build:
name: Build the topic pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
submodules: true
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.72.0
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
activate-environment: true
frozen: true
- name: Install npm packages
shell: bash {0}
run: pixi run npm install
- name: Build
shell: bash {0}
run: pixi run pytask
run-ty:
name: Run ty
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
submodules: true
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.72.0
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
frozen: true
- name: Run ty
run: pixi run prek run ty --all-files
shell: bash -el {0}
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule ".ai-instructions"]
path = .ai-instructions
url = https://github.com/OpenSourceEconomics/ai-instructions
22 changes: 16 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
# - id: check-hooks-apply # Leave nbqa in here.
# - id: identity # Prints all files passed to pre-commits. Debugging.
- repo: https://github.com/lyz-code/yamlfix
rev: 1.18.0
rev: 1.19.1
hooks:
- id: yamlfix
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -23,7 +23,6 @@ repos:
- id: end-of-file-fixer
- id: fix-byte-order-marker
types: [text]
- id: forbid-submodules
- id: mixed-line-ending
args: [--fix=lf]
description: Forces to replace line ending by the UNIX 'lf' character.
Expand All @@ -33,11 +32,11 @@ repos:
- id: check-ast
- id: check-docstring-first
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.37.1
rev: v1.38.0
hooks:
- id: yamllint
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.13.3
rev: v0.15.20
hooks:
# Run the linter.
- id: ruff
Expand All @@ -47,19 +46,30 @@ repos:
# Run the formatter.
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/astral-sh/ty-pre-commit
rev: v0.0.56
hooks:
- id: ty
# `--no-project` stops uv from creating a `.venv`/`uv.lock` in this
# pixi-managed repo; ty resolves third-party imports from the env named
# in `[tool.ty] environment.python` (run `pixi install` once).
args: [--no-project]
- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
rev: 0.9.1
hooks:
- id: nbstripout
args:
- --extra-keys
- metadata.kernelspec metadata.language_info.version metadata.vscode
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.22
rev: 1.0.0
hooks:
- id: mdformat
additional_dependencies: [mdformat-myst, mdformat-ruff]
args: [--wrap, '88']
exclude: slides.md|instructions.md
ci:
autoupdate_schedule: monthly
# pre-commit.ci has no pixi environments and blocks network at hook runtime;
# the GitHub Actions `run-ty` job covers type checking.
skip: [ty]
27 changes: 27 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@.ai-instructions/profiles/tier-b-course.md @.ai-instructions/modules/pytask.md

# Effective Programming Practices for Economists: Topics

Source for the topic pages at https://effective-programming-practices.vercel.app/, built
via https://github.com/OpenSourceEconomics/effective-programming-practices. Each topic
lives under `src/epp_topics/<area>/<topic>/` and holds its objectives, materials, and,
where relevant, a `screencast/` (Slidev slides) and an `example/` project.

## Build and test

```bash
# Set up the environment (uses Pixi, not conda or pip)
pixi install
npm install

# Build every topic page
pixi run pytask
```

## Conventions

- Slides are written in Slidev (`screencast/slides.md`); static export goes through
`npx slidev export` and needs the npm packages installed.
- Example projects under a topic's `example/` directory carry their own `pyproject.toml`
and pixi environment; run them with an explicit `--manifest-path`, never with the
working directory inside the example.
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
Loading
Loading