← Patch adatlapja
AgentPatch
4. Static Typecheckers (
Python-függőségek frissítése
A projekt feloldója, támogatott Python-verziói és platformfüggő binárisai alapján tervez célzott csomagfrissítést.
python-dependency-upgrades
Nézd meg, miben segítMikor hasznos?
Akkor használd, ha csomagváltás zárolófájlra, natív csomagra, típusokra vagy keretműködésre hathat több környezetben.
Miben segít neked?
- Azonosítja a feloldót, zárolófájlt és Python-verziókorlátokat.
- Támogatott platformokon ellenőrzi a bináris csomagot és natív bővítményt.
- Korlátozza a csomagváltozást, teszteli a keret- és típusmigrációt.
Például ezt kérheted
Frissíts egy Python-csomagot a többi függőség váratlan cseréje nélkül. Támogatott Python-verzión oldd fel és telepítsd, majd tesztelj érintett importot. Nézd át a lockfile változásait és a szükséges natív csomagok elérhetőségét.
Részletes dokumentáció
Itt a skill eredeti útmutatóját, példáit és ellenőrzési szempontjait olvashatod az eredeti nyelven.
Összecsukás
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.
Csomagban lévő fájlok 1
SKILL.md
