Update Dev Requirements
Updates requirements-dev.in with latest package versions from PyPI while preserving version specifier patterns.
How It Works
For each package in requirements-dev.in:
Parse the version pattern to understand the "fixed part":
pytest==8.*→ fixed:8, wildcard at minor levelruff==0.*→ fixed:0, wildcard at minor levelpytest-cov==7.*→ fixed:7, wildcard at minor level
Query PyPI for the latest version
Update while preserving pattern:
pytest==8.*with latest8.4.0→pytest==8.*(already allows 8.x)ruff==0.*with latest0.9.2→ruff==0.*(already allows 0.x)
Execution Steps
- Read
requirements-dev.infrom the current project - For each line with a package version:
- Skip git dependencies (lines with
@orgit+) - Parse package name and version pattern
- Fetch latest version from PyPI:
curl -s https://pypi.org/pypi/{package}/json | jq -r .info.version - Calculate new version with same pattern depth
- Skip git dependencies (lines with
- Show diff of proposed changes
- Apply changes after user confirmation
Version Pattern Rules
| Original | Latest on PyPI | Result |
|---|---|---|
pkg==1.2.* |
1.5.3 |
pkg==1.5.* |
pkg==1.* |
2.3.0 |
pkg==2.* |
pkg==1.2.3 |
1.5.3 |
pkg==1.5.3 |
Skip These Lines
- Git dependencies:
pkg @ git+https://... - Comments: Lines starting with
# - Empty lines
- Extras without version:
pkg[extra]
Example Output
Checking requirements-dev.in for updates...
Package Current Latest Status
pytest 8.* 9.0.0 UPDATE → 9.*
ruff 0.* 0.14.3 OK (already matches)
commitizen 4.* 4.9.1 OK (already matches)
Apply updates? [y/N]
After applying changes
Recompile the dev lockfile with uv:
uv pip compile requirements-dev.in -o requirements-dev.txt --upgrade
The .in file is human-edited; .txt is the generated, fully-resolved lockfile that local dev and the CI test image install from.