Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action

name: Set up build environment
description: Installs dependencies
runs:
using: composite
steps:
Expand All @@ -9,9 +10,8 @@ runs:
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
cache-dependency-glob: requirements.txt
activate-environment: true
- name: Install packages
run: uv pip install --system -r requirements.txt
run: uv sync --locked
# https://stackoverflow.com/a/71042698/358804
shell: bash
3 changes: 2 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ version: 2

python:
install:
- requirements: requirements.txt
- method: uv
command: sync

build:
os: ubuntu-lts-latest
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ site:
jupyter-book build --all -W -n --keep-going .

setup:
uv venv .venv
uv sync
uv pip install --python .venv/bin/python \
-r requirements.txt \
-r extras/autograder/source/requirements.txt

update_packages:
uv pip install --python .venv/bin/python --upgrade -r requirements.txt
uv sync --upgrade

./extras/scripts/update_lectures.sh

Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ only_build_toc_files: true
exclude_patterns:
- .github/*
- .pytest_cache/*
- .venv/*
- tmp/*

execute:
Expand Down
6 changes: 2 additions & 4 deletions extras/autograder/source/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

set -ex

apt-get install -y python3 curl
curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"
apt-get install -y python3 python3-pip

uv pip install --system -r /autograder/source/requirements.txt
pip3 install -r /autograder/source/requirements.txt
2 changes: 1 addition & 1 deletion meta/instructor_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _While this is meant as internal documentation for the instructor, others are we

## Adding/updating packages

1. Modify [`requirements.txt`](https://github.com/afeld/python-public-policy/blob/main/requirements.txt)
1. Modify the dependencies in [`pyproject.toml`](https://github.com/afeld/python-public-policy/blob/main/pyproject.toml)
1. Run

```sh
Expand Down
54 changes: 51 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,59 @@
[project]
name = "python-public-policy"
version = "0.0.0"
requires-python = ">=3.12"
dependencies = [
# local development
"jupyterlab",
"notebook==7.*",
"ruff",

# extensions
"jupyter-resource-usage",

# packages imported directly in notebooks
# .python-version should match version in Colab returned by `!python --version`. Below, match versions in Colab returned by `!pip list` for packages where the interface may change.
# required for pandas' read_html()
"html5lib",
"lxml",
"pandas==2.2.3",
# Using v6 (newer than Colab) to avoid the need for the plugin in the base environment, and 6.0.1+ to avoid a bug in the HTML export.
# https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#301----2025-02-18
"plotly>=6.0.1",
"requests==2.32.4",
"statsmodels==0.14.6",
"scipy",

# supporting packages for notebooks
"ipykernel",
# https://plotly.com/python/static-image-export/
"kaleido",
# required for plotly rendering
# https://github.com/plotly/plotly.py/blob/v6.0.0/packages/python/plotly/io/_renderers.py#L426
"nbformat>=4.2.0",
# needed for plotly
# https://plotly.com/python/getting-started/#jupyterlab-support
"anywidget",
"isoduration",
"jupyter-book==1.*",

# CI
"jinja2",
"nbconvert[webpdf]>=7.16.6",
"nbdime",
"pytest",
"sphinx>=6.2.0",
]

[tool.uv]
package = false

# https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
check_untyped_defs = true

[tool.pytest.ini_options]
addopts = [
"--ignore=extras/autograder/",
]
addopts = ["--ignore=extras/autograder/"]

[tool.ruff]
extend-exclude = ["final_project/*.ipynb"]
44 changes: 0 additions & 44 deletions requirements.txt

This file was deleted.

Loading
Loading