← Back to Desktop app developers
See how it helps
4. Static Typecheckers (
Python dependency upgrades
Plans focused Python upgrades around the project’s resolver, supported interpreters and platform-specific binary dependencies.
python-dependency-upgrades
Team members using this skill
When is it useful?
Use it when a package change could affect lockfiles, native wheels, typing or framework behavior across environments.
What does it help you do?
- Identifies the project’s resolver, lockfile and Python constraints.
- Checks wheel availability and native extensions across supported platforms.
- Limits package movement and tests framework or typing migrations.
Try asking this
Upgrade one Python package without unexpectedly refreshing unrelated dependencies. Resolve and install on the supported Python version, then test one affected import path. Review lockfile movement and availability of required native wheels.
Detailed documentation
Read the skill’s original instructions, examples and checks in their authored language.
Show less
Python Dependency Upgrades
When to Use
Use when upgrading Python libraries, frameworks (FastAPI, Django, Flask, SQLAlchemy, Celery, Pydantic, Pytest), data/ML libraries (NumPy, Pandas, SciPy, PyTorch), or Python runtime versions (requires-python).
Environment & Tooling Discovery
1. Identify the Active Resolver & Lock Mechanism
Never mix Python package managers or run bare global pip install:
uv(pyproject.toml+uv.lock): Useuv lock --upgrade-package <pkg>followed byuv sync(oruv run pytest). Verify lock consistency withuv lock --check.- Poetry (
pyproject.toml+poetry.lock): Usepoetry update <pkg>(neverpoetry lockwithout--no-updateon older Poetry v1 unless intending to refresh all unlocked packages; in Poetry 1.8+/2.0,poetry lockpreserves existing locked versions by default). Verify withpoetry check --lock. pip-tools(requirements.in$\rightarrow$requirements.txt): Usepip-compile --upgrade-package <pkg> --generate-hashes requirements.inso only the targeted package and its sub-dependencies move.- Pipenv (
Pipfile+Pipfile.lock): Usepipenv update <pkg>. -Always activate or execute inside the project's virtual environment (.venv,uv run,poetry run).
2. Python Version Markers & Binary Wheel Availability
- Inspect
requires-pythoninpyproject.toml(e.g.,>=3.11,<3.14),.python-version,Dockerfilebase images (python:3.12-slim-bookworm), and CI matrix versions. - Multi-platform lockfiles (
uv.lock,poetry.lock) resolve environment markers (sys_platform,platform_machine,implementation_name) across macOS (arm64/x86_64), Linux (manylinuxglibc vsmusllinuxAlpine), and Windows. - Check C/Rust extension packages (
psycopg/psycopg2-binary,cryptography,orjson,pydantic-core,pillow,lxml,numpy,scipy,grpcio):- Confirm prebuilt
manylinux/musllinux/macosxwheels exist on PyPI for the target Python version so production or CI builds do not unexpectedly fall back to slow, fragile source compilation requiringgcc,rustup,libpq-dev, orpython3-dev.
- Confirm prebuilt
Ecosystem-Specific Upgrade Contracts
1. Pydantic v1 $\rightarrow$ v2 & FastAPI / SQLModel Alignment
- Check whether any dependency still imports
pydantic.v1or relies on Pydantic v1 APIs (@validator$\rightarrow$@field_validator,@root_validator$\rightarrow$@model_validator,.dict()$\rightarrow$.model_dump(),.json()$\rightarrow$.model_dump_json(),.parse_obj()$\rightarrow$.model_validate(),class Config$\rightarrow$model_config = ConfigDict(...),BaseSettingsmoved topydantic-settings). - Upgrade
pydantic,pydantic-core,pydantic-settings, andfastapiin compatible combinations.
2. SQLAlchemy 1.4 $\rightarrow$ 2.0 & Alembic
- Watch for 2.0 contract shifts: legacy
session.query()vsselect()+session.execute().scalars(), explicitsession.commit()/ transaction boundaries,DeclarativeBaseandMapped[...]/mapped_column(...)typing, and removed implicit autocommit (engine.execute()removed in favor ofwith engine.connect() as conn:). - Ensure database driver packages (
asyncpg,psycopg[binary],aiomysql,aiosqlite) match SQLAlchemy's dialect expectations.
3. Django LTS & Async / Middleware / Form Changes
- Check Django's official release notes for removed deprecation shims (
USE_L10N,DEFAULT_FILE_STORAGE$\rightarrow$STORAGESdict,index_together$\rightarrow$Meta.indexes,url()$\rightarrow$path()/re_path(), CSRFCSRF_TRUSTED_ORIGINSscheme requirements). - Run
python manage.py check --deployandpython manage.py makemigrations --check --dry-runafter every Django or third-party app upgrade to confirm zero unapplied model/migration drift.
4. Static Typecheckers (mypy, pyright) & pytest
- When upgrading
mypy,pyright, ortypes-*stub packages (types-requests,types-redis,types-PyYAML,django-stubs), fix newly uncovered Optional/Union or generic invariance issues in code rather than adding blanket# type: ignore. - Run
pytest -W error::DeprecationWarningon targeted modules to surface deprecations before the next major upgrade.
Included files 1
SKILL.md
