Skip to content

Commit

Permalink
use uv
Browse files Browse the repository at this point in the history
  • Loading branch information
ngalaiko committed Jan 20, 2025
1 parent a286800 commit 5deac05
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 16 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/daily.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v5
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
cache: "pip"
- run: python3 -m venv venv
- run: source venv/bin/activate
- run: python3 -m pip install -r requirements.txt
enable-cache: true
cache-suffix: "optional-suffix"

- run: python3 ./scripts/update/letterboxd.py
- run: uv run ./scripts/update/letterboxd.py
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update movies

- run: python3 ./scripts/update/discogs.py --token "${{ secrets.DISCOGS_API_KEY }}"
- run: uv run ./scripts/update/discogs.py --token "${{ secrets.DISCOGS_API_KEY }}"
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update records
Expand All @@ -38,7 +37,7 @@ jobs:
ref: "master"
- name: Setup hledger
uses: ngalaiko/setup-hledger@v1
- run: python3 ./scripts/update/hledger.py --file "$GITHUB_WORKSPACE/ledger/main.ledger"
- run: uv run ./scripts/update/hledger.py --file "$GITHUB_WORKSPACE/ledger/main.ledger"
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update Restaurants and Cafes
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
FROM python:3.12-alpine3.20 as build
FROM ghcr.io/astral-sh/uv:python3.13-alpine as build
WORKDIR /app
RUN apk add --update --no-cache \
imagemagick imagemagick-dev libjpeg-turbo-dev libpng-dev libwebp-dev \
pandoc \
make \
jq \
yq
COPY requirements.txt requirements.txt
RUN pip install --break-system-packages -r requirements.txt
RUN wget --quiet "https://github.com/cooklang/cookcli/releases/download/v0.8.0/cook-x86_64-unknown-linux-musl.tar.gz" \
&& echo "4e1b95202d92b492027a5df2f78624679f93f368a9b5832e2ec94f518890f130 cook-x86_64-unknown-linux-musl.tar.gz" | sha256sum -c \
&& tar -xzf "cook-x86_64-unknown-linux-musl.tar.gz" -C /usr/bin
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PANDOC_BIN := pandoc
IMAGEMAGICK_BIN := magick
JQ_BIN := jq
YQ_BIN := yq
J2_BIN := python3 ./scripts/jinja.py
J2_BIN := uv run -s ./scripts/jinja.py
COOK_BIN := cook

# Find input files
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ my website

## requirements

- [python3](https://www.python.org)
- [uv](https://docs.astral.sh/uv)
- [bash](https://www.gnu.org/software/bash/)
- [make](https://www.gnu.org/software/make/)
- [sed](https://www.gnu.org/software/sed/)
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

7 changes: 7 additions & 0 deletions scripts/jinja.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "jinja2",
# "python-slugify",
# ]
# ///
import sys
import json
import jinja2
Expand Down
6 changes: 6 additions & 0 deletions scripts/update/discogs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "python-slugify",
# ]
# ///
import os
import time
import argparse
Expand Down
6 changes: 6 additions & 0 deletions scripts/update/hledger.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "python-slugify",
# ]
# ///
import csv
from slugify import slugify
import subprocess
Expand Down
6 changes: 6 additions & 0 deletions scripts/update/letterboxd.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "beautifulsoup4",
# ]
# ///
from bs4 import BeautifulSoup
import argparse
import json
Expand Down

0 comments on commit 5deac05

Please sign in to comment.