Skip to content

Commit 175cd86

Browse files
committed
More changes stemming from pip to uv migration.
1 parent 0b683a4 commit 175cd86

2 files changed

Lines changed: 15 additions & 16 deletions

File tree

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ These scripts will:
132132
After adding an image to a post, run the optimization script to convert it to WebP and resize it for the web:
133133

134134
```bash
135-
python3 scripts/optimize_image.py docs/posts/YYYY/MM/DD/your_image.png
135+
uv run python scripts/optimize_image.py docs/posts/YYYY/MM/DD/your_image.png
136136
```
137137

138138
This will create an optimized `.webp` file alongside the original. Update your post's markdown to reference the new `.webp` file, then delete the original if no longer needed.
@@ -148,13 +148,13 @@ This will create an optimized `.webp` file alongside the original. Update your p
148148

149149
```bash
150150
# Optimize a single image with defaults
151-
python3 scripts/optimize_image.py docs/posts/2026/04/14/photo.png
151+
uv run python scripts/optimize_image.py docs/posts/2026/04/14/photo.png
152152

153153
# Batch optimize multiple images
154-
python3 scripts/optimize_image.py docs/posts/2026/04/14/*.png docs/posts/2026/04/14/*.jpg
154+
uv run python scripts/optimize_image.py docs/posts/2026/04/14/*.png docs/posts/2026/04/14/*.jpg
155155

156156
# Custom quality and max width
157-
python3 scripts/optimize_image.py --quality 90 --max-width 1600 image.jpeg
157+
uv run python scripts/optimize_image.py --quality 90 --max-width 1600 image.jpeg
158158
```
159159

160160

@@ -167,15 +167,15 @@ To see all categories and tags currently in use, run:
167167

168168
**Bash (Linux/macOS)**:
169169
```bash
170-
python3 scripts/find_tags_categories.py
170+
uv run python scripts/find_tags_categories.py
171171
```
172172

173173
**PowerShell (Windows)**:
174174
```powershell
175-
python scripts/find_tags_categories.py
175+
uv run python scripts/find_tags_categories.py
176176
```
177177

178-
This script requires `pyyaml`, which is included in `requirements.txt`. It is also run automatically by the `create_post` scripts when scaffolding a new post.
178+
This script requires `pyyaml`, which is included in the dev dependencies. It is also run automatically by the `create_post` scripts when scaffolding a new post.
179179

180180
## Updating Sponsors
181181

@@ -186,12 +186,11 @@ Sponsor and donor entries live in [`data/sponsors.yml`](data/sponsors.yml), whic
186186
```
187187
.
188188
├── mkdocs.yml # Main configuration file
189-
├── requirements.txt # Python dependencies
189+
├── pyproject.toml # Python dependencies + uv config
190+
├── uv.lock # Locked dependency tree
190191
├── docker-compose.yml # Docker development environment
191192
├── create_post.sh # Bash script to create blog posts
192193
├── create_post.ps1 # PowerShell script to create blog posts
193-
├── requirements-dev.in # Dev-only dependency pins (e.g. Pillow)
194-
├── requirements-dev.txt # Compiled dev dependencies
195194
├── scripts/
196195
│ ├── find_tags_categories.py # List all existing tags and categories
197196
│ └── optimize_image.py # Optimize images for the web (PNG/JPEG → WebP)
@@ -229,15 +228,15 @@ mkdocs build # Build static site to site/ directory
229228
mkdocs build --clean # Clean build
230229

231230
# Optimize an image for the web
232-
python3 scripts/optimize_image.py docs/posts/YYYY/MM/DD/image.png
231+
uv run python scripts/optimize_image.py docs/posts/YYYY/MM/DD/image.png
233232

234233
# Help
235234
mkdocs -h # Show help
236235

237236
# Docker
238237
docker compose up app # Start development server (with hot reloading)
239238
docker compose down # Stop containers
240-
docker compose down -v # Stop containers and remove volumes (pip cache)
239+
docker compose down -v # Stop containers and remove volumes (uv cache)
241240
```
242241

243242
## Deployment

scripts/optimize_image.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
except ImportError:
2828
print(
2929
"Error: Pillow is not installed.\n"
30-
"Install dev dependencies with:\n"
31-
" pip install -r requirements-dev.txt\n"
32-
"Or install Pillow directly:\n"
33-
" pip install Pillow",
30+
"Install the project dependencies with:\n"
31+
" uv sync\n"
32+
"Then run this script with:\n"
33+
" uv run python scripts/optimize_image.py ...",
3434
file=sys.stderr,
3535
)
3636
sys.exit(1)

0 commit comments

Comments
 (0)