upgrade-python

upgrade-python is a skill for Claude Code, Codex from Phaedra-Solutions/cursor-rules. It costs 137 tokens per session (1,438 once invoked), scanned A, original, MIT.

A guided process for moving a project's Python interpreter through newer minor releases, updating version settings and dependencies together, and checking native extensions and tests.

In plain words
What is it for?
Use it to upgrade Python one minor release at a time, refresh locked dependencies, update Docker, CI, and deployment settings, and verify the result with tests.
Why use it?
It prevents different parts of the project from requiring conflicting Python versions and catches deprecations or dependency problems during the upgrade.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to upgrade Python one minor release at a time, refresh locked dependencies, update Docker, CI, and deployment settings, and verify the result with tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/phaedra-solutions/cursor-rules/upgrade-python
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Phaedra-Solutions/cursor-rules --skill upgrade-python
Clone the repo
git clone --depth 1 https://github.com/Phaedra-Solutions/cursor-rules

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for upgrade-python

README.md
[![agentmods](https://agentmods.dev/badge/skills/phaedra-solutions/cursor-rules/upgrade-python/github.svg)](https://agentmods.dev/skills/phaedra-solutions/cursor-rules/upgrade-python)
Your own site
<a href="https://agentmods.dev/skills/phaedra-solutions/cursor-rules/upgrade-python"><img src="https://agentmods.dev/badge/skills/phaedra-solutions/cursor-rules/upgrade-python/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for upgrade-python

Your own site · 80×15
<a href="https://agentmods.dev/skills/phaedra-solutions/cursor-rules/upgrade-python"><img src="https://agentmods.dev/badge/skills/phaedra-solutions/cursor-rules/upgrade-python.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 137 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,438 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00137 $0.01438
Opus 5.5 $0.00055 $0.00575
Sonnet 5.5 $0.00027 $0.00288
Haiku 4.5 $0.00014 $0.00144

Measured 3d ago against content hash bca00e5c676e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

upgrade-python scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/upgrade-python/SKILL.md · 76 lines

How it starts

The opening of the file, as written. The whole thing — 76 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Upgrade Python

When to use

  • The user asks to upgrade Python, or the project runs an EOL version (3.10 or older; see legacy/python-legacy).
  • A dependency upgrade (Django 6.x, SQLAlchemy 2.1, Starlette 1.x) needs a newer Python.
  • Planning ahead: 3.11 reaches EOL in Oct 2027.

Before you start

  • List every place that pins Python: requires-python, .python-version, runtime.txt, tox.ini/noxfile.py, setup.cfg classifiers, Dockerfiles (FROM python:…), CI matrices, serverless/PaaS runtimes, and type-checker settings (pythonVersion, python_version).
  • List C-extension and binary dependencies (numpy, pandas, psycopg, cryptography, lxml, grpcio, pydantic-core, anything without wheels for the target).
  • Working tree clean; new branch (chore/python-3.13).
  • Ask the user:
    • the target: 3.13 (security support to Oct 2029; most compatible) or 3.14 (bugfix, to Oct 2030). 3.15 (Oct 2026) is fine for new work once dependencies publish wheels;
    • whether to stop for review after each minor hop;
    • whether network installs are approved (core/supply-chain cooldown applies).

Steps

  1. Baseline on the current version: locked install, lint, type check, tests, and the production image starting. Record failures first.

  2. Surface the next version's breakage now: run the tests with warnings as errors on the current version:

    uv run python -W error::DeprecationWarning -W error::PendingDeprecationWarning -m pytest
    

    Fix each warning (or record it with the owning dependency) before changing versions.

  3. Hop one minor version (for example 3.10 → 3.11):

    • install it (uv python install 3.11) and update all pins in one change (requires-python = ">=3.11", .python-version, Docker base image by digest, CI, runtimes, type-checker version);
    • re-lock (uv lock --upgrade-package <only what's needed> or a full uv lock if the user agrees) and sync;
    • update packages without wheels for the new version, or replace unmaintained ones;
    • run pyupgrade --py311-plus $(git ls-files '*.py') (match the flag to the new minimum: --py312-plus, --py313-plus, --py314-plus) and review the diff; Ruff's UP rules with target-version do the same.
  4. Fix version-specific changes listed in that version's "What's New" (Porting section). Common ones:

    • 3.11: asyncio.coroutine removed; stricter enum and typing behavior;
    • 3.12: distutils removed (use setuptools/packaging); imp removed; datetime.utcnow() deprecated (use datetime.now(UTC));
    • 3.13: dead batteries removed (cgi, crypt, telnetlib, nntplib, imghdr, pipes, …); locale.getdefaultlocale deprecated;
    • 3.14: deferred evaluation of annotations by default; asyncio child-watcher APIs removed.
  5. Verify (next section). Show the diff and results; wait for approval before the next hop. Commit only when asked (git-commit skill).

  6. Repeat until the target, then switch to languages/python and update the frameworks' version rules if needed.

Read the full file on GitHub · 76 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 76 lines · 137 tokens per session scan A bca00e5c676e

Subscribe to this mod's changes

upgrade-python is a skill published in the GitHub repository Phaedra-Solutions/cursor-rules (4 stars, last pushed 2d ago), licensed MIT. It adds 137 tokens to every session and 1,438 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-01.