Skip to content

Commit 1146a3d

Browse files
committed
More changes stemming from pip to uv migration.
1 parent 2ed1368 commit 1146a3d

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,27 +167,26 @@ 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
## Project Structure
181181

182182
```
183183
.
184184
├── mkdocs.yml # Main configuration file
185-
├── requirements.txt # Python dependencies
185+
├── pyproject.toml # Python dependencies + uv config
186+
├── uv.lock # Locked dependency tree
186187
├── docker-compose.yml # Docker development environment
187188
├── create_post.sh # Bash script to create blog posts
188189
├── create_post.ps1 # PowerShell script to create blog posts
189-
├── requirements-dev.in # Dev-only dependency pins (e.g. Pillow)
190-
├── requirements-dev.txt # Compiled dev dependencies
191190
├── scripts/
192191
│ ├── find_tags_categories.py # List all existing tags and categories
193192
│ └── optimize_image.py # Optimize images for the web (PNG/JPEG → WebP)
@@ -221,15 +220,15 @@ mkdocs build # Build static site to site/ directory
221220
mkdocs build --clean # Clean build
222221

223222
# Optimize an image for the web
224-
python3 scripts/optimize_image.py docs/posts/YYYY/MM/DD/image.png
223+
uv run python scripts/optimize_image.py docs/posts/YYYY/MM/DD/image.png
225224

226225
# Help
227226
mkdocs -h # Show help
228227

229228
# Docker
230229
docker compose up app # Start development server (with hot reloading)
231230
docker compose down # Stop containers
232-
docker compose down -v # Stop containers and remove volumes (pip cache)
231+
docker compose down -v # Stop containers and remove volumes (uv cache)
233232
```
234233

235234
## 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)